2005-08-24 02:53:38 +00:00
|
|
|
using System;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace AMXXRelease
|
|
|
|
{
|
|
|
|
//Build process for Windows (32bit)
|
|
|
|
public class Win32Builder : ABuilder
|
|
|
|
{
|
|
|
|
private string m_AmxxPc;
|
|
|
|
|
|
|
|
public override void OnBuild()
|
|
|
|
{
|
|
|
|
m_AmxxPc = PropSlashes(m_Cfg.GetSourceTree() + "\\plugins\\amxxpc.exe");
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void CompressDir(string target, string dir)
|
|
|
|
{
|
|
|
|
ProcessStartInfo info = new ProcessStartInfo();
|
|
|
|
|
|
|
|
info.FileName = m_Cfg.CompressPath();
|
2005-08-25 08:02:48 +00:00
|
|
|
info.WorkingDirectory = dir;
|
2006-08-28 03:27:16 +00:00
|
|
|
info.Arguments = "-r \"" + target + ".zip\" " + "*.*";
|
2005-08-24 02:53:38 +00:00
|
|
|
info.UseShellExecute = false;
|
|
|
|
|
|
|
|
Process p = Process.Start(info);
|
|
|
|
p.WaitForExit();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void AmxxPc(string inpath, string args)
|
|
|
|
{
|
|
|
|
ProcessStartInfo info = new ProcessStartInfo();
|
|
|
|
|
|
|
|
info.WorkingDirectory = PropSlashes(m_Cfg.GetSourceTree() + "\\plugins");
|
|
|
|
info.FileName = (string)m_AmxxPc.Clone();
|
|
|
|
info.Arguments = inpath + ".sma";
|
|
|
|
if (args != null)
|
|
|
|
info.Arguments += " " + args;
|
|
|
|
info.UseShellExecute = false;
|
2007-08-03 17:26:57 +00:00
|
|
|
info.RedirectStandardOutput = true;
|
|
|
|
info.RedirectStandardError = true;
|
2005-08-24 02:53:38 +00:00
|
|
|
|
|
|
|
Process p = Process.Start(info);
|
2007-08-03 17:26:57 +00:00
|
|
|
Console.WriteLine(p.StandardOutput.ReadToEnd() + "\n");
|
2005-08-24 02:53:38 +00:00
|
|
|
p.WaitForExit();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string GetLibExt()
|
|
|
|
{
|
|
|
|
return ".dll";
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string BuildModule(Module module)
|
|
|
|
{
|
|
|
|
ProcessStartInfo info = new ProcessStartInfo();
|
|
|
|
|
|
|
|
string dir = m_Cfg.GetSourceTree() + "\\" + module.sourcedir;
|
|
|
|
if (module.bindir != null)
|
|
|
|
dir += "\\" + module.bindir;
|
|
|
|
string file = dir;
|
|
|
|
if (module.bindir == null)
|
|
|
|
file += "\\" + module.bindir;
|
|
|
|
file += "\\" + module.build + "\\" + module.projname + ".dll";
|
|
|
|
file = PropSlashes(file);
|
|
|
|
|
|
|
|
if (File.Exists(file))
|
|
|
|
File.Delete(file);
|
|
|
|
|
2007-03-13 00:29:10 +00:00
|
|
|
string args = m_Cfg.MakeOpts();
|
|
|
|
if (args != null)
|
|
|
|
{
|
2007-08-03 16:48:04 +00:00
|
|
|
info.Arguments = args + " ";
|
2007-03-13 00:29:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
info.Arguments = "";
|
2011-07-02 02:51:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
info.WorkingDirectory = PropSlashes(dir);
|
2011-06-29 05:50:14 +00:00
|
|
|
info.FileName = m_Cfg.DevenvPath();
|
2011-07-02 02:51:27 +00:00
|
|
|
info.Arguments += module.vcproj + ".sln" + " /p:Configuration=" + module.build + " /t:Rebuild";
|
2005-08-24 02:53:38 +00:00
|
|
|
info.UseShellExecute = false;
|
2007-08-03 17:26:57 +00:00
|
|
|
info.RedirectStandardOutput = true;
|
|
|
|
info.RedirectStandardError = true;
|
2005-08-24 02:53:38 +00:00
|
|
|
|
|
|
|
Process p = Process.Start(info);
|
2007-08-03 17:26:57 +00:00
|
|
|
Console.WriteLine(p.StandardOutput.ReadToEnd());
|
2005-08-24 02:53:38 +00:00
|
|
|
p.WaitForExit();
|
2007-08-03 17:26:57 +00:00
|
|
|
p.Close();
|
2005-08-24 02:53:38 +00:00
|
|
|
|
|
|
|
if (!File.Exists(file))
|
2007-08-03 17:26:57 +00:00
|
|
|
{
|
2005-08-24 02:53:38 +00:00
|
|
|
return null;
|
2007-08-03 17:26:57 +00:00
|
|
|
}
|
2005-08-24 02:53:38 +00:00
|
|
|
|
|
|
|
return file;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|