Improved diagnostic message when nant is not installed.

Fixed bug that caused OpenTK.sln generation to run twice.
This commit is contained in:
the_fiddler 2009-05-31 15:02:27 +00:00
parent d92e410cbb
commit d91cf4101c

View file

@ -72,16 +72,19 @@ namespace OpenTK.Build
{ {
PrintUsage(); PrintUsage();
args = new string[2]; args = new string[2] { String.Empty, String.Empty };
Console.Write("Select build target: "); Console.Write("Select build target: ");
args[0] = Console.ReadLine(); args[0] = Console.ReadLine();
if (args[0] == String.Empty) if (args[0] == String.Empty)
args[0] = "vs"; args[0] = "vs";
if (args[0] != "vs")
{
Console.Write("Select build mode (optional): "); Console.Write("Select build mode (optional): ");
args[1] = Console.ReadLine(); args[1] = Console.ReadLine();
if (args[0] == String.Empty) if (args[1] == String.Empty)
args[0] = "release"; args[1] = "release";
}
} }
RootPath = Directory.GetParent(Directory.GetCurrentDirectory()).FullName; RootPath = Directory.GetParent(Directory.GetCurrentDirectory()).FullName;
@ -95,7 +98,7 @@ namespace OpenTK.Build
foreach (string s in args) foreach (string s in args)
{ {
string arg = s.ToLower(); string arg = s.ToLower().Trim();
switch (arg) switch (arg)
{ {
case "debug": case "debug":
@ -147,11 +150,15 @@ namespace OpenTK.Build
target = BuildTarget.DistClean; target = BuildTarget.DistClean;
break; break;
case "":
break;
default: default:
Console.WriteLine("Unknown command: {0}", s); Console.WriteLine("Unknown command: {0}", s);
PrintUsage(); PrintUsage();
return; return;
} }
}
BinPath = Path.Combine("Binaries", mode == BuildMode.Debug ? "Debug" : "Release"); BinPath = Path.Combine("Binaries", mode == BuildMode.Debug ? "Debug" : "Release");
ExePath = Path.Combine(BinPath, "Exe"); ExePath = Path.Combine(BinPath, "Exe");
@ -230,7 +237,6 @@ namespace OpenTK.Build
//Console.WriteLine("Press any key to continue..."); //Console.WriteLine("Press any key to continue...");
//Console.ReadKey(true); //Console.ReadKey(true);
} }
}
static void DeleteDirectories(string root_path, string search) static void DeleteDirectories(string root_path, string search)
{ {
@ -336,11 +342,11 @@ namespace OpenTK.Build
static void ExecuteProcess(string path, string args) static void ExecuteProcess(string path, string args)
{ {
ProcessStartInfo sinfo = new ProcessStartInfo();
using (Process p = new Process()) using (Process p = new Process())
{ {
try try
{ {
ProcessStartInfo sinfo = new ProcessStartInfo();
if (Environment.OSVersion.Platform == PlatformID.Unix && !path.ToLower().Contains("nant")) if (Environment.OSVersion.Platform == PlatformID.Unix && !path.ToLower().Contains("nant"))
{ {
sinfo.FileName = "mono"; sinfo.FileName = "mono";
@ -371,7 +377,7 @@ namespace OpenTK.Build
} }
catch (Exception) catch (Exception)
{ {
Console.WriteLine("Failed to execute process: {0}", p.ProcessName); Console.WriteLine("Failed to execute process: {0}", sinfo.FileName);
} }
} }