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