diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index 1a2e11e2..07982ac6 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -610,9 +610,9 @@ function vc200x.VCNMakeTool(cfg) _p(3,'') end end @@ -840,6 +843,14 @@ end + function vc2010.nmakeCommandLine(cfg, commands, phase) + if #commands > 0 then + commands = table.concat(premake.esc(commands), io.eol) + _p(2, '%s', phase, commands, phase) + end + end + + function vc2010.nmakeOutput(cfg) _p(2,'$(OutDir)%s', cfg.buildtarget.name) end diff --git a/src/base/api.lua b/src/base/api.lua index 070a7e94..5f358834 100644 --- a/src/base/api.lua +++ b/src/base/api.lua @@ -513,6 +513,13 @@ }, } + api.register { + name = "buildcommands", + scope = "config", + kind = "string-list", + tokens = true, + } + api.register { name = "buildoptions", scope = "config", @@ -527,6 +534,13 @@ tokens = true, } + api.register { + name = "cleancommands", + scope = "config", + kind = "string-list", + tokens = true, + } + api.register { name = "configmap", scope = "config", @@ -871,6 +885,13 @@ tokens = true, } + api.register { + name = "rebuildcommands", + scope = "config", + kind = "string-list", + tokens = true, + } + api.register { name = "resdefines", scope = "config", diff --git a/tests/actions/vstudio/vc200x/test_nmake_settings.lua b/tests/actions/vstudio/vc200x/test_nmake_settings.lua index bb1a79d6..e610404d 100644 --- a/tests/actions/vstudio/vc200x/test_nmake_settings.lua +++ b/tests/actions/vstudio/vc200x/test_nmake_settings.lua @@ -67,3 +67,56 @@ Output="$(OutDir)MyProject.exe" ]] end + + +-- +-- Verify generation of the build commands. +-- + + function suite.buildCommandLine_onSingleCommand() + buildcommands { "command 1" } + prepare() + test.capture [[ + ]] end + + +-- +-- Verify generation of the build commands. +-- + + function suite.buildCommandLine_onSingleCommand() + buildcommands { "command 1" } + prepare() + test.capture [[ + + $(OutDir)MyProject + command 1 + + ]] + end + + function suite.buildCommandLine_onMultipleCommands() + buildcommands { "command 1", "command 2" } + prepare() + test.capture [[ + + $(OutDir)MyProject + command 1 +command 2 + + ]] + end + + function suite.rebuildCommandLine() + rebuildcommands { "command 1" } + prepare() + test.capture [[ + + $(OutDir)MyProject + command 1 + + ]] + end + + function suite.cleanCommandLine() + cleancommands { "command 1" } + prepare() + test.capture [[ + + $(OutDir)MyProject + command 1 + + ]] + end