From c15788d8fe61cf53c36970b5220b890c8d63543c Mon Sep 17 00:00:00 2001 From: "rglarix@bitbucket.org" Date: Sat, 26 Mar 2011 13:01:18 +0100 Subject: enable optional scripts option even for release builds --HG-- branch : scripts-option-rel --- src/host/premake.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/host/premake.c b/src/host/premake.c index ac27566..9498bb2 100755 --- a/src/host/premake.c +++ b/src/host/premake.c @@ -20,6 +20,7 @@ static int process_arguments(lua_State* L, int argc, const char** argv); static int process_option(lua_State* L, const char* arg); +static int load_file_scripts(lua_State* L); static int load_builtin_scripts(lua_State* L); int premake_locate(lua_State* L, const char* argv0); @@ -99,8 +100,22 @@ int premake_execute(lua_State* L, int argc, const char** argv) int z = process_arguments(L, argc, argv); /* Run the built-in Premake scripts */ - if (z == OKAY) z = load_builtin_scripts(L); - + if (z == OKAY) + { +#if !defined(NDEBUG) + z = load_file_scripts(L); +#else + if (scripts_path) + { + z = load_file_scripts(L); + } + else + { + z = load_builtin_scripts(L); + } +#endif + } + return z; } @@ -200,7 +215,7 @@ int premake_locate(lua_State* L, const char* argv0) * but I need the value of the /scripts option to find them. * \returns OKAY if successful. */ -int process_arguments(lua_State* L, int argc, const char** argv) +static int process_arguments(lua_State* L, int argc, const char** argv) { int i; @@ -247,7 +262,7 @@ int process_arguments(lua_State* L, int argc, const char** argv) * Parse an individual command-line option. * \returns OKAY if successful. */ -int process_option(lua_State* L, const char* arg) +static int process_option(lua_State* L, const char* arg) { char key[512]; const char* value; @@ -276,6 +291,7 @@ int process_option(lua_State* L, const char* arg) if (strcmp(key, "scripts") == 0 && strlen(value) > 0) { scripts_path = value; + printf("Scripts path: %s\n", value); } return OKAY; @@ -283,13 +299,12 @@ int process_option(lua_State* L, const char* arg) -#if !defined(NDEBUG) /** * When running in debug mode, the scripts are loaded from the disk. The path to * the scripts must be provided via either the /scripts command line option or * the PREMAKE_PATH environment variable. */ -int load_builtin_scripts(lua_State* L) +static int load_file_scripts(lua_State* L) { const char* filename; @@ -335,16 +350,14 @@ int load_builtin_scripts(lua_State* L) return (int)lua_tonumber(L, -1); } } -#endif -#if defined(NDEBUG) /** * When running in release mode, the scripts are loaded from a static data * buffer, where they were stored by a preprocess. To update these embedded * scripts, run `premake4 embed` then rebuild. */ -int load_builtin_scripts(lua_State* L) +static int load_builtin_scripts(lua_State* L) { int i; for (i = 0; builtin_scripts[i]; ++i) @@ -368,4 +381,4 @@ int load_builtin_scripts(lua_State* L) return (int)lua_tonumber(L, -1); } } -#endif + -- cgit v1.2.3 From bbe6694950faf8f556432283bc5bb5d718e3c8e7 Mon Sep 17 00:00:00 2001 From: Ben Rog-Wilhelm Date: Tue, 26 Nov 2013 18:13:30 -0800 Subject: Fix vs2013 action. --- src/actions/vstudio/vs2013.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/actions/vstudio/vs2013.lua b/src/actions/vstudio/vs2013.lua index 8654f21..6d25981 100644 --- a/src/actions/vstudio/vs2013.lua +++ b/src/actions/vstudio/vs2013.lua @@ -4,9 +4,13 @@ -- Copyright (c) 2013 Jason Perkins and the Premake project -- + premake.vstudio.vc2013 = {} + local vc2013 = premake.vstudio.vc2013 + local vstudio = premake.vstudio + --- --- Register a command-line action for Visual Studio 2012. +-- Register a command-line action for Visual Studio 2013. --- newaction -- cgit v1.2.3 From 926c32fbacf45335d2ab241e258a7d6f3b9a858e Mon Sep 17 00:00:00 2001 From: Ryan Mulder Date: Thu, 12 Dec 2013 16:36:46 -0500 Subject: Separate sibling and system libraries (as the gmake action does), so the name can be properly formatted for each Avoids truncation when the name containes a dot, e.g. 'wx_gtk2ud_propgrid-2.8' --- src/actions/codelite/codelite_project.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/actions/codelite/codelite_project.lua b/src/actions/codelite/codelite_project.lua index c10569e..0d65863 100644 --- a/src/actions/codelite/codelite_project.lua +++ b/src/actions/codelite/codelite_project.lua @@ -95,9 +95,12 @@ for _,v in ipairs(premake.getlinks(cfg, "all", "directory")) do _p(' ', premake.esc(v)) end - for _,v in ipairs(premake.getlinks(cfg, "all", "basename")) do + for _,v in ipairs(premake.getlinks(cfg, "siblings", "basename")) do _p(' ', premake.esc(v)) end + for _,v in ipairs(premake.getlinks(cfg, "system", "name")) do + _p(' ', premake.esc(v)) + end _p(' ') -- end linker block -- -- cgit v1.2.3 From 9b08b51306bfbfc25bf7a0149ec9874c607fcfb0 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 7 Jan 2014 09:22:53 +0000 Subject: Ignoring Visual Lint files (updated .hgignore) --HG-- branch : vslint-ignore --- .hgignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.hgignore b/.hgignore index d35b7f0..ade2dcb 100644 --- a/.hgignore +++ b/.hgignore @@ -29,3 +29,5 @@ Scratchpad.txt Unix Worksheet.worksheet project.bbprojectdata Premake4.tmproj +Visual Lint/PC-lint/**.vlstatus +*.lnt -- cgit v1.2.3 From e099a3d740ca409c4fe8a07c677d7c9ec1f835ce Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 7 Jan 2014 09:24:17 +0000 Subject: Fixing: resincludedirs broken in premake-stable (only affects ResourceCompile sections) --HG-- branch : resincludes-fix --- src/actions/vstudio/vs2010_vcxproj.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index b6b44e7..4adef79 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -181,10 +181,18 @@ end end + local function resinclude_dirs(indent,cfg) + if #cfg.includedirs > 0 or #cfg.resincludedirs > 0 then + local dirs = table.join(cfg.includedirs, cfg.resincludedirs) + _p(indent,'%s;%%(AdditionalIncludeDirectories)' + ,premake.esc(path.translate(table.concat(dirs, ";"), '\\'))) + end + end + local function resource_compile(cfg) _p(2,'') preprocessor(3,cfg) - include_dirs(3,cfg) + resinclude_dirs(3,cfg) _p(2,'') end -- cgit v1.2.3 From d32485d3764b59e63febc0fec3b5291532926ae7 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 7 Jan 2014 23:41:20 +0000 Subject: Allowing the mapping between the global solution configuration and the project configurations to be overridden --HG-- branch : sln2proj_map_override_for_merge --- src/actions/vstudio/vs2005_solution.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/actions/vstudio/vs2005_solution.lua b/src/actions/vstudio/vs2005_solution.lua index d5b0298..77928d8 100644 --- a/src/actions/vstudio/vs2005_solution.lua +++ b/src/actions/vstudio/vs2005_solution.lua @@ -86,7 +86,16 @@ _p('\tEndGlobalSection') end +-- +-- Write a single solution to project mapping (ActiveCfg and Build.0 lines) +-- + function sln2005.project_platforms_sln2prj_mapping(sln, prj, cfg, mapped) + _p('\t\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) + if mapped == cfg.platform or cfg.platform == "Mixed Platforms" then + _p('\t\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) + end + end -- -- Write out the contents of the ProjectConfigurationPlatforms section, which maps @@ -111,11 +120,7 @@ mapped = cfg.platform end end - - _p('\t\t{%s}.%s.ActiveCfg = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) - if mapped == cfg.platform or cfg.platform == "Mixed Platforms" then - _p('\t\t{%s}.%s.Build.0 = %s|%s', prj.uuid, cfg.name, cfg.buildcfg, mapped) - end + sln2005.project_platforms_sln2prj_mapping(sln, prj, cfg, mapped) end end _p('\tEndGlobalSection') -- cgit v1.2.3 From 8614fe302c57a2df13660da07e10c5dcb3e5c9d6 Mon Sep 17 00:00:00 2001 From: jimstitt Date: Fri, 17 Jan 2014 23:05:54 -0500 Subject: Add support for xaml extension. --- src/actions/vstudio/vs2005_csproj.lua | 16 ++++++++++++++++ src/tools/dotnet.lua | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua index c4fc815..36a9ea8 100644 --- a/src/actions/vstudio/vs2005_csproj.lua +++ b/src/actions/vstudio/vs2005_csproj.lua @@ -33,6 +33,13 @@ if premake.findfile(prj, testname) then return "AutoGen", testname end + elseif fname:endswith(".xaml.cs") then + -- is there a matching *.cs file? + local basename = fname:sub(1, -9) + local testname = basename .. ".xaml" + if premake.findfile(prj, testname) then + return "SubTypeCode", testname + end else -- is there a *.Designer.cs file? local basename = fname:sub(1, -4) @@ -61,6 +68,10 @@ end end end + + if fname:endswith(".xaml") then + return "XamlDesigner" + end if action == "Content" then return "CopyNewest" @@ -107,6 +118,11 @@ _p(' Designer') elseif elements == "SubTypeForm" then _p(' Form') + elseif elements == "SubTypeCode" then + _p(' Code') + elseif elements == "XamlDesigner" then + _p(' Designer') + _p(' MSBuild:Compile') elseif elements == "PreserveNewest" then _p(' PreserveNewest') end diff --git a/src/tools/dotnet.lua b/src/tools/dotnet.lua index 69feffa..c52d326 100644 --- a/src/tools/dotnet.lua +++ b/src/tools/dotnet.lua @@ -3,7 +3,6 @@ -- Interface for the C# compilers, all of which are flag compatible. -- Copyright (c) 2002-2009 Jason Perkins and the Premake project -- - premake.dotnet = { } premake.dotnet.namestyle = "windows" @@ -36,6 +35,12 @@ return "EmbeddedResource" elseif fcfg.buildaction == "Copy" or ext == ".asax" or ext == ".aspx" then return "Content" + elseif fcfg.buildaction == "Page" or ext == ".xaml" then + if ( path.getname( fcfg.name ) == "App.xaml" ) then + return "ApplicationDefinition" + else + return "Page" + end else return "None" end -- cgit v1.2.3 From 3e948de858d2686f2216240e0f50a3aed9caa09d Mon Sep 17 00:00:00 2001 From: jimstitt Date: Fri, 17 Jan 2014 23:09:02 -0500 Subject: removed path extension from .net links. --- src/actions/vstudio/vs2005_csproj.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua index 36a9ea8..afa3710 100644 --- a/src/actions/vstudio/vs2005_csproj.lua +++ b/src/actions/vstudio/vs2005_csproj.lua @@ -253,7 +253,7 @@ _p(' %s', premake.esc(ref.name)) _p(' ') end - for _, linkname in ipairs(premake.getlinks(prj, "system", "basename")) do + for _, linkname in ipairs(premake.getlinks(prj, "system", "name")) do _p(' ', premake.esc(linkname)) end _p(' ') -- cgit v1.2.3 From c08979cd95356070d6c873481a9797706f9784a5 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Thu, 30 Jan 2014 03:52:22 +0000 Subject: Expose the former local blockmap as vc200x.toolmap to allow overriding it Move the handling of VCPreBuildEventTool, VCPreLinkEventTool and VCPostBuildEventTool into the aforementioned map (getting rid of a few stray tabs around the location of the changes) --HG-- branch : Allow_Override_VCTool_Elements --- src/actions/vstudio/vs200x_vcproj.lua | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/actions/vstudio/vs200x_vcproj.lua b/src/actions/vstudio/vs200x_vcproj.lua index ee69357..3ef4e8b 100644 --- a/src/actions/vstudio/vs200x_vcproj.lua +++ b/src/actions/vstudio/vs200x_vcproj.lua @@ -589,7 +589,7 @@ -- an empty element. -- - local blockmap = + vc200x.toolmap = { VCCLCompilerTool = vc200x.VCCLCompilerTool, VCCLCompilerTool_PS3 = vc200x.VCCLCompilerTool_PS3, @@ -598,9 +598,12 @@ VCManifestTool = vc200x.VCManifestTool, VCMIDLTool = vc200x.VCMIDLTool, VCResourceCompilerTool = vc200x.VCResourceCompilerTool, + VCPreBuildEventTool = function(cfg) vc200x.buildstepsblock("VCPreBuildEventTool", cfg.prebuildcommands) end, + VCPreLinkEventTool = function(cfg) vc200x.buildstepsblock("VCPreLinkEventTool", cfg.prelinkcommands) end, + VCPostBuildEventTool = function(cfg) vc200x.buildstepsblock("VCPostBuildEventTool", cfg.postbuildcommands) end, } - - + + -- -- Return a list of sections for a particular Visual Studio version and target platform. -- @@ -733,21 +736,12 @@ local cfg = premake.getconfig(prj, cfginfo.src_buildcfg, cfginfo.src_platform) -- Start a configuration - vc200x.Configuration(cfginfo.name, cfg) + vc200x.Configuration(cfginfo.name, cfg) for _, block in ipairs(getsections(_ACTION, cfginfo.src_platform)) do - if blockmap[block] then - blockmap[block](cfg) - - -- Build event blocks -- - elseif block == "VCPreBuildEventTool" then - vc200x.buildstepsblock("VCPreBuildEventTool", cfg.prebuildcommands) - elseif block == "VCPreLinkEventTool" then - vc200x.buildstepsblock("VCPreLinkEventTool", cfg.prelinkcommands) - elseif block == "VCPostBuildEventTool" then - vc200x.buildstepsblock("VCPostBuildEventTool", cfg.postbuildcommands) - -- End build event blocks -- - + if vc200x.toolmap[block] then + vc200x.toolmap[block](cfg) + -- Xbox 360 custom sections -- elseif block == "VCX360DeploymentTool" then _p(3,' Date: Tue, 4 Feb 2014 00:31:53 +0000 Subject: src\actions\make\make_cpp.lua --HG-- branch : fix_issue214 --- src/actions/make/make_cpp.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/src/actions/make/make_cpp.lua b/src/actions/make/make_cpp.lua index 44c5b2a..4caf055 100644 --- a/src/actions/make/make_cpp.lua +++ b/src/actions/make/make_cpp.lua @@ -324,6 +324,7 @@ function cpp.pchrules(prj) _p('ifneq (,$(PCH))') + _p('.NOTPARALLEL: $(GCH) $(PCH)') _p('$(GCH): $(PCH)') _p('\t@echo $(notdir $<)') -- cgit v1.2.3 From e7090dfb5eb0e1ef79d765f543517cff364e82b6 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 5 Feb 2014 02:15:38 +0000 Subject: This fixes issue #41 by simply resetting the indentation to its default at the beginning of solution generation, i.e. in vs2005.generateSolution, shared by all VS implementations --HG-- branch : fix_issue41 --- src/actions/vstudio/vs2002_solution.lua | 1 + src/actions/vstudio/vs2003_solution.lua | 1 + src/actions/vstudio/vs2005_solution.lua | 1 + 3 files changed, 3 insertions(+) diff --git a/src/actions/vstudio/vs2002_solution.lua b/src/actions/vstudio/vs2002_solution.lua index 37a60bc..f8845fd 100644 --- a/src/actions/vstudio/vs2002_solution.lua +++ b/src/actions/vstudio/vs2002_solution.lua @@ -9,6 +9,7 @@ local sln2002 = premake.vstudio.sln2002 function sln2002.generate(sln) + io.indent = nil -- back to default io.eol = '\r\n' -- Precompute Visual Studio configurations diff --git a/src/actions/vstudio/vs2003_solution.lua b/src/actions/vstudio/vs2003_solution.lua index 9c4d6a9..bb5ca27 100644 --- a/src/actions/vstudio/vs2003_solution.lua +++ b/src/actions/vstudio/vs2003_solution.lua @@ -10,6 +10,7 @@ function sln2003.generate(sln) + io.indent = nil -- back to default io.eol = '\r\n' -- Precompute Visual Studio configurations diff --git a/src/actions/vstudio/vs2005_solution.lua b/src/actions/vstudio/vs2005_solution.lua index 77928d8..b0942db 100644 --- a/src/actions/vstudio/vs2005_solution.lua +++ b/src/actions/vstudio/vs2005_solution.lua @@ -10,6 +10,7 @@ function sln2005.generate(sln) + io.indent = nil -- back to default io.eol = '\r\n' -- Precompute Visual Studio configurations -- cgit v1.2.3 From 512b469e45d4f9101739d1380c571a10d0288f57 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 5 Feb 2014 04:01:20 +0000 Subject: Same changes to ignor files as for premake-dev --HG-- branch : oliver_ignore_pclint_visuallint --- .gitignore | 3 +++ .hgignore | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7ded8a3..a5dcc88 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ syntax: glob .DS_Store +*.bak *.orig *~ @@ -11,6 +12,8 @@ obj release ipch src/host/scripts.c +**.lnt +**.vlstatus Makefile *.make diff --git a/.hgignore b/.hgignore index ade2dcb..a5dcc88 100644 --- a/.hgignore +++ b/.hgignore @@ -2,12 +2,18 @@ syntax: glob .DS_Store +*.bak +*.orig +*~ + build bin obj release ipch src/host/scripts.c +**.lnt +**.vlstatus Makefile *.make @@ -29,5 +35,3 @@ Scratchpad.txt Unix Worksheet.worksheet project.bbprojectdata Premake4.tmproj -Visual Lint/PC-lint/**.vlstatus -*.lnt -- cgit v1.2.3 From 0f3d12d715954b883358d920cdaadcb2d0210ec8 Mon Sep 17 00:00:00 2001 From: jimstitt Date: Fri, 7 Feb 2014 16:58:54 -0500 Subject: Remove path from xaml file dependency. --- src/actions/vstudio/vs2005_csproj.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua index afa3710..c8542c9 100644 --- a/src/actions/vstudio/vs2005_csproj.lua +++ b/src/actions/vstudio/vs2005_csproj.lua @@ -38,7 +38,7 @@ local basename = fname:sub(1, -9) local testname = basename .. ".xaml" if premake.findfile(prj, testname) then - return "SubTypeCode", testname + return "SubTypeCode", path.getname(testname) end else -- is there a *.Designer.cs file? -- cgit v1.2.3 From 6871e492b12a29a027287398f544d5503ae6922d Mon Sep 17 00:00:00 2001 From: Damien Courtois Date: Thu, 3 Apr 2014 12:02:13 +0200 Subject: added a test to ensure VS macros are correctly handled in include paths. --HG-- branch : test_vs_macros --- tests/actions/vstudio/test_vs2010_vcxproj.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/actions/vstudio/test_vs2010_vcxproj.lua b/tests/actions/vstudio/test_vs2010_vcxproj.lua index c5b3401..c11ec9e 100644 --- a/tests/actions/vstudio/test_vs2010_vcxproj.lua +++ b/tests/actions/vstudio/test_vs2010_vcxproj.lua @@ -2,6 +2,7 @@ local vs10_vcxproj = T.vs2010_vcxproj local include_directory = "bar/foo" local include_directory2 = "baz/foo" + local include_directory_vs_macros = "$(Macro1)/foo/bar/$(Macro2)/baz" local debug_define = "I_AM_ALIVE_NUMBER_FIVE" local vc2010 = premake.vstudio.vc2010 @@ -25,7 +26,8 @@ includedirs { include_directory, - include_directory2 + include_directory2, + include_directory_vs_macros } files { @@ -168,6 +170,13 @@ test.string_contains(buffer,cl_compile_string('Debug').. '.*.*'.. path.translate(include_directory2, '\\') ..';.*') end + function vs10_vcxproj.includeDirectories_debugEntryContains_include_directory_vs_macros() + local buffer = get_buffer() + -- visual studio macros use $ as a prefix, which is a special regex character, so we need to replace them. + local search_string = string.gsub(include_directory_vs_macros, "%$", "%$%") + test.string_contains(buffer,cl_compile_string('Debug').. '.*.*'.. path.translate(search_string, '\\') ..'.*') + end + function vs10_vcxproj.debugContainsPreprossorBlock() local buffer = get_buffer() test.string_contains(buffer,cl_compile_string('Debug').. '.*.*') -- cgit v1.2.3 From a411a4265650779087894d662a84c028c3ca1035 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Thu, 3 Apr 2014 11:10:28 -0400 Subject: Issue #236: Fix failing PCH unit tests --- tests/actions/make/test_make_pch.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/actions/make/test_make_pch.lua b/tests/actions/make/test_make_pch.lua index 18e6026..500f2ae 100644 --- a/tests/actions/make/test_make_pch.lua +++ b/tests/actions/make/test_make_pch.lua @@ -66,6 +66,7 @@ _.pchrules(prj) test.capture [[ ifneq (,$(PCH)) +.NOTPARALLEL: $(GCH) $(PCH) $(GCH): $(PCH) @echo $(notdir $<) $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" @@ -79,6 +80,7 @@ $(GCH): $(PCH) _.pchrules(prj) test.capture [[ ifneq (,$(PCH)) +.NOTPARALLEL: $(GCH) $(PCH) $(GCH): $(PCH) @echo $(notdir $<) $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -- cgit v1.2.3 From 0c1e1741b36b6beb83c8b5288b0cca0d340fde5b Mon Sep 17 00:00:00 2001 From: Damien Courtois Date: Tue, 22 Apr 2014 14:27:27 +0200 Subject: added post and pre build events support for C# projects --HG-- branch : issue_60 --- src/actions/vstudio/vs2005_csproj.lua | 20 +++++++++++ tests/actions/vstudio/cs2005/buildevents.lua | 53 ++++++++++++++++++++++++++++ tests/premake4.lua | 1 + 3 files changed, 74 insertions(+) create mode 100644 tests/actions/vstudio/cs2005/buildevents.lua diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua index afa3710..0b45c82 100644 --- a/src/actions/vstudio/vs2005_csproj.lua +++ b/src/actions/vstudio/vs2005_csproj.lua @@ -207,6 +207,23 @@ end end +-- +-- Write the build events groups. +-- + + function cs2005.buildevents(cfg) + if #cfg.prebuildcommands > 0 then + _p(' ') + _p(' %s', premake.esc(table.implode(cfg.prebuildcommands, "", "", "\r\n"))) + _p(' ') + end + if #cfg.postbuildcommands > 0 then + _p(' ') + _p(' %s', premake.esc(table.implode(cfg.postbuildcommands, "", "", "\r\n"))) + _p(' ') + end + end + -- -- The main function: write the project file. @@ -265,6 +282,9 @@ local msbuild = iif(_ACTION < "vs2012", "Bin", "Tools") _p(' ', msbuild) + -- build events + cs2005.buildevents(prj) + _p('