public static int Main(string[] args) { try { ArgHash = GetArguments(args); //ProjectDir = @"D:\projects\Sharpkit\SharpkitTest"; ProjectDir = Environment.CurrentDirectory; if (ArgHash.getValue("compile", "1") == "1") //--> /compile:0 for skip compiling { Compile(); } if (ArgHash.getValue("compare", "1") == "1") //--> /compare:0 for skip comparing { Compare(); } return(0); } catch (Exception e) { WriteLine(e.Message, ConsoleColor.Red); if (ArgHash.ContainsKey("wait")) { Console.WriteLine("Press any key to continue..."); Console.ReadKey(); } if (ErrorCount == 0) { return(-1); } return(ErrorCount); } }
public static void Compile() { var version = ArgHash.getValue("version", "current"); var runner = new MSBUildRunner(ProjectDir); runner.Defines.Add(version.ToUpper()); if (!runner.Execute()) { throw new Exception("Compilation not successfull"); } }