From 2776b538edf96ffbfe73abbe09270af3cf091483 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 --- 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('