Flag fields containing command lines and expand tokens during baking

This commit is contained in:
Jason Perkins 2014-11-27 13:12:36 -05:00
parent 5d327279cc
commit d645ba7c8f
3 changed files with 17 additions and 3 deletions

View File

@ -68,6 +68,7 @@
scope = { "config", "rule" },
kind = "list:string",
tokens = true,
commands = true,
}
api.alias("buildcommands", "buildCommands")
@ -128,6 +129,7 @@
scope = "config",
kind = "list:string",
tokens = true,
commands = true,
}
@ -572,6 +574,7 @@
scope = "config",
kind = "list:string",
tokens = true,
commands = true,
}
api.register {
@ -586,6 +589,7 @@
scope = "config",
kind = "list:string",
tokens = true,
commands = true,
}
api.register {
@ -600,6 +604,7 @@
scope = "config",
kind = "list:string",
tokens = true,
commands = true,
}
api.register {
@ -620,6 +625,7 @@
scope = "config",
kind = "list:string",
tokens = true,
commands = true,
}
api.register {

View File

@ -203,10 +203,11 @@
end
end
if #prj.prebuildcommands > 0 or #prj.postbuildcommands > 0 then
local cfg = project.getfirstconfig(prj)
if #cfg.prebuildcommands > 0 or #cfg.postbuildcommands > 0 then
_p(1,'<PropertyGroup>')
output("Pre", prj.prebuildcommands)
output("Post", prj.postbuildcommands)
output("Pre", cfg.prebuildcommands)
output("Post", cfg.postbuildcommands)
_p(1,'</PropertyGroup>')
end
end

View File

@ -489,6 +489,13 @@
ctx.location = ctx.location or prj.location
context.basedir(ctx, ctx.location)
-- Translate any tokens in command line fields
for f in p.field.each() do
if f.commands then
ctx[f.name] = os.translateCommand(ctx[f.name])
end
end
-- Fill in a few calculated for the configuration, including the long
-- and short names and the build and link target.