From 4dcd1bc7240bda58daf6951748548ef3e14c2436 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Fri, 9 Jul 2010 17:25:15 +0000 Subject: [PATCH] Release and Debug builds implemented in Builder --- Builder/IISMainHandler/build.txt | 2 +- Builder/IISMainHandler/product.wxs | 70 +++++++++++++++--------------- Builder/IISUploadHandler/build.txt | 2 +- Builder/Program.cs | 25 +++++++++-- build-all.bat | 10 +++-- 5 files changed, 65 insertions(+), 44 deletions(-) diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 4ffc0cd..633a077 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -670 \ No newline at end of file +685 \ No newline at end of file diff --git a/Builder/IISMainHandler/product.wxs b/Builder/IISMainHandler/product.wxs index 4bdd16b..3188e6c 100644 --- a/Builder/IISMainHandler/product.wxs +++ b/Builder/IISMainHandler/product.wxs @@ -1,12 +1,12 @@ - - - + + + - + @@ -15,76 +15,78 @@ - - - - - - + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - + + - + - + @@ -137,8 +139,8 @@ - - + + diff --git a/Builder/IISUploadHandler/build.txt b/Builder/IISUploadHandler/build.txt index cdf1f34..7b89b22 100644 --- a/Builder/IISUploadHandler/build.txt +++ b/Builder/IISUploadHandler/build.txt @@ -1 +1 @@ -403 \ No newline at end of file +406 \ No newline at end of file diff --git a/Builder/Program.cs b/Builder/Program.cs index fe6670c..2c73f60 100644 --- a/Builder/Program.cs +++ b/Builder/Program.cs @@ -32,18 +32,35 @@ namespace Builder { string WIXPATH = ConfigurationManager.AppSettings["WiXPath"]; string SVNPATH = ConfigurationManager.AppSettings["SVNPath"]; - if(args.Length != 1) throw new ApplicationException("You should specify project name first"); + if(args.Length < 1) throw new ApplicationException("You should specify project name first"); string path = args[0]; if(!Directory.Exists(path)) throw new ApplicationException("Directory doesn't exists"); string fullPath = new DirectoryInfo(path).FullName; fullPath += Path.DirectorySeparatorChar; + string target = "release"; + string targetId = "1"; + if(args.Length > 1) { + switch(args[1].ToLower()) { + case "release": + target = "release"; + targetId = "1"; + break; + case "debug": + target = "debug"; + targetId = "2"; + break; + default: + throw new ApplicationException("Wrong target"); + } + } + string sourceFile = fullPath + "product.wxs"; if(!File.Exists(sourceFile)) throw new ApplicationException("No wxs file could be found"); string targetFile = fullPath + "product.wixobj"; - string wixPdbFile = fullPath + "product.wixpdb"; - string outputFile = fullPath + "product.msi"; + string wixPdbFile = fullPath + "product-" + target + ".wixpdb"; + string outputFile = fullPath + "product-" + target + ".msi"; string prebuildCommands = fullPath + "prebuild.bat"; string postbuildCommands = fullPath + "postbuild.bat"; string buildNumberFile = fullPath + "build.txt"; @@ -95,7 +112,7 @@ namespace Builder { using(StreamReader sourceReader = new StreamReader(sourceFile)) { wxsData = sourceReader.ReadToEnd(); } - wxsData = wxsData.Replace("{rev}", revNumber.ToString()).Replace("{build}", buildNumber.ToString()); + wxsData = wxsData.Replace("{rev}", revNumber.ToString()).Replace("{build}", buildNumber.ToString()).Replace("{target}", target).Replace("{targetId}", targetId); using(StreamWriter tempWriter = tempFile.getWriter()) { tempWriter.Write(wxsData); diff --git a/build-all.bat b/build-all.bat index a49d4b9..a6a3d21 100644 --- a/build-all.bat +++ b/build-all.bat @@ -1,7 +1,9 @@ @echo off @rem Note that this script will only produce a .msi packet of your binaries and data. It will not compile your sources. cd Builder -Builder IISMainHandler -move /Y IISMainHandler\product.msi ..\IISMainHandler.msi -Builder IISUploadHandler -move /Y IISUploadHandler\product.msi ..\IISUploadHandler.msi \ No newline at end of file +Builder IISMainHandler debug +move /Y IISMainHandler\product-debug.msi ..\IISMainHandler-debug.msi +Builder IISMainHandler release +move /Y IISMainHandler\product-release.msi ..\IISMainHandler-release.msi +rem Builder IISUploadHandler release +rem move /Y IISUploadHandler\product-release.msi ..\IISUploadHandler-release.msi \ No newline at end of file