Add rule .props file support for buildCommands, buildOutputs, buildMessage, buildDependencies

This commit is contained in:
Jason Perkins 2014-09-03 16:14:42 -04:00
parent 98aba2438f
commit 1f1f5bee5f
2 changed files with 61 additions and 7 deletions

View File

@ -86,12 +86,6 @@
}, },
} }
api.register {
name = "buildmessage",
scope = "config",
kind = "string",
tokens = true,
}
api.register { api.register {
name = "buildcommands", name = "buildcommands",
@ -102,6 +96,25 @@
api.alias("buildcommands", "buildCommands") api.alias("buildcommands", "buildCommands")
api.register {
name = "buildDependencies",
scope = { "rule" },
kind = "list:string",
tokens = true,
}
api.register {
name = "buildmessage",
scope = { "config", "rule" },
kind = "string",
tokens = true
}
api.alias("buildmessage", "buildMessage")
api.register { api.register {
name = "buildoptions", name = "buildoptions",
scope = "config", scope = "config",
@ -109,13 +122,17 @@
tokens = true, tokens = true,
} }
api.register { api.register {
name = "buildoutputs", name = "buildoutputs",
scope = "config", scope = { "config", "rule" },
kind = "list:path", kind = "list:path",
tokens = true, tokens = true,
} }
api.alias("buildoutputs", "buildOutputs")
api.register { api.register {
name = "buildrule", -- DEPRECATED name = "buildrule", -- DEPRECATED
scope = "config", scope = "config",

View File

@ -83,6 +83,10 @@
m.elements.ruleGroup = function(r) m.elements.ruleGroup = function(r)
return { return {
m.propertyDefaults, m.propertyDefaults,
m.commandLineTemplates,
m.outputs,
m.executionDescription,
m.additionalDependencies,
} }
end end
@ -120,6 +124,13 @@
-- Implementations of individual elements. -- Implementations of individual elements.
--- ---
function m.additionalDependencies(r)
local deps = table.concat(r.buildDependencies, ";")
p.x('<AdditionalDependencies>%s</AdditionalDependencies>', deps)
end
function m.afterTargets(r) function m.afterTargets(r)
p.w('<%sAfterTargets>CustomBuild</%sAfterTargets>', r.name, r.name) p.w('<%sAfterTargets>CustomBuild</%sAfterTargets>', r.name, r.name)
end end
@ -131,9 +142,35 @@
end end
function m.commandLineTemplates(r)
if #r.buildcommands then
local cmds = table.concat(r.buildcommands, p.eol())
p.x('<CommandLineTemplate>%s</CommandLineTemplate>', cmds)
end
end
function m.dependsOn(r) function m.dependsOn(r)
p.w('<%sDependsOn', r.name) p.w('<%sDependsOn', r.name)
p.w(' Condition="\'$(ConfigurationType)\' != \'Makefile\'">_SelectedFiles;$(%sDependsOn)</%sDependsOn>', p.w(' Condition="\'$(ConfigurationType)\' != \'Makefile\'">_SelectedFiles;$(%sDependsOn)</%sDependsOn>',
r.name, r.name, r.name) r.name, r.name, r.name)
end end
function m.executionDescription(r)
if r.buildmessage then
p.x('<ExecutionDescription>%s</ExecutionDescription>', r.buildmessage)
end
end
function m.outputs(r)
if #r.buildoutputs then
local outputs = table.concat(r.buildoutputs, ";")
p.x('<Outputs>%s</Outputs>', path.translate(outputs))
end
end