Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Courtois <none@none>2014-04-22 16:27:27 +0400
committerDamien Courtois <none@none>2014-04-22 16:27:27 +0400
commit0c1e1741b36b6beb83c8b5288b0cca0d340fde5b (patch)
tree7a42aefa621c93953295396ac337ac34ce7f67c8 /src/actions
parent80adf90f70ae04e75216b014cc0f8983bb24de0b (diff)
added post and pre build events support for C# projects
--HG-- branch : issue_60
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/vstudio/vs2005_csproj.lua20
1 files changed, 20 insertions, 0 deletions
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(' <PropertyGroup>')
+ _p(' <PreBuildEvent>%s</PreBuildEvent>', premake.esc(table.implode(cfg.prebuildcommands, "", "", "\r\n")))
+ _p(' </PropertyGroup>')
+ end
+ if #cfg.postbuildcommands > 0 then
+ _p(' <PropertyGroup>')
+ _p(' <PostBuildEvent>%s</PostBuildEvent>', premake.esc(table.implode(cfg.postbuildcommands, "", "", "\r\n")))
+ _p(' </PropertyGroup>')
+ end
+ end
+
--
-- The main function: write the project file.
@@ -265,6 +282,9 @@
local msbuild = iif(_ACTION < "vs2012", "Bin", "Tools")
_p(' <Import Project="$(MSBuild%sPath)\\Microsoft.CSharp.targets" />', msbuild)
+ -- build events
+ cs2005.buildevents(prj)
+
_p(' <!-- To modify your build process, add your task inside one of the targets below and uncomment it.')
_p(' Other similar extension points exist, see Microsoft.Common.targets.')
_p(' <Target Name="BeforeBuild">')