Updated Build.exe and Prebuild.xml to copy data files and dll.config files in all cases.

This commit is contained in:
the_fiddler 2007-10-20 14:17:51 +00:00
parent 81ba27da98
commit 5b7c1e2384

View file

@ -251,9 +251,10 @@ namespace OpenTK.Build
Directory.CreateDirectory(ExamplePath);
Directory.CreateDirectory(DataPath);
// Handled by Prebuild.exe now.
// Copy Data files for the Examples.
foreach (string file in Directory.GetFiles(DataSourcePath))
File.Copy(file, Path.Combine(DataPath, Path.GetFileName(file)));
//foreach (string file in Directory.GetFiles(DataSourcePath))
// File.Copy(file, Path.Combine(DataPath, Path.GetFileName(file)));
// Move the libraries and the config files.
FindFiles(SourcePath, "*.dll", dll_matches);
@ -330,35 +331,43 @@ namespace OpenTK.Build
{
using (Process p = new Process())
{
ProcessStartInfo sinfo = new ProcessStartInfo();
if (Environment.OSVersion.Platform == PlatformID.Unix && !path.ToLower().Contains("nant"))
try
{
sinfo.FileName = "mono";
sinfo.Arguments = path + " " + args;
ProcessStartInfo sinfo = new ProcessStartInfo();
if (Environment.OSVersion.Platform == PlatformID.Unix && !path.ToLower().Contains("nant"))
{
sinfo.FileName = "mono";
sinfo.Arguments = path + " " + args;
}
else
{
sinfo.FileName = path;
sinfo.Arguments = args;
}
sinfo.WorkingDirectory = RootPath;
sinfo.CreateNoWindow = true;
sinfo.RedirectStandardOutput = true;
sinfo.UseShellExecute = false;
p.StartInfo = sinfo;
p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);
p.Start();
p.BeginOutputReadLine();
//StreamReader sr = p.StandardOutput;
//while (!p.HasExited)
//{
// Console.WriteLine(sr.ReadLine());
// Console.Out.Flush();
//}
p.WaitForExit();
}
else
catch (Exception e)
{
sinfo.FileName = path;
sinfo.Arguments = args;
Console.WriteLine("Failed to execute process: {0}", p.ProcessName);
}
sinfo.WorkingDirectory = RootPath;
sinfo.CreateNoWindow = true;
sinfo.RedirectStandardOutput = true;
sinfo.UseShellExecute = false;
p.StartInfo = sinfo;
p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);
p.Start();
p.BeginOutputReadLine();
//StreamReader sr = p.StandardOutput;
//while (!p.HasExited)
//{
// Console.WriteLine(sr.ReadLine());
// Console.Out.Flush();
//}
p.WaitForExit();
}
}
static void p_OutputDataReceived(object sender, DataReceivedEventArgs e)