2005-08-24 02:53:38 +00:00
|
|
|
using System;
|
|
|
|
using System.Diagnostics;
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace AMXXRelease
|
|
|
|
{
|
|
|
|
//Entry point for application.
|
|
|
|
//1. Reads config file
|
|
|
|
//2. Instantiates correct build process (ABuilder)
|
|
|
|
//3. Instantiates the build (Build)
|
|
|
|
//4. Passes configuration and build to the Builder
|
|
|
|
public class Releaser
|
|
|
|
{
|
|
|
|
private Config m_Cfg;
|
2005-08-24 05:19:23 +00:00
|
|
|
public static bool IsWindows;
|
2005-08-24 02:53:38 +00:00
|
|
|
|
|
|
|
[STAThread]
|
|
|
|
static void Main(string[] args)
|
|
|
|
{
|
|
|
|
string file;
|
|
|
|
if (args.GetLength(0) < 1)
|
|
|
|
file = "release.info";
|
|
|
|
else
|
|
|
|
file = args[0];
|
|
|
|
|
|
|
|
Releaser r = new Releaser();
|
|
|
|
|
|
|
|
r.Release(file);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Release(string file)
|
|
|
|
{
|
|
|
|
m_Cfg = new Config();
|
|
|
|
|
|
|
|
file = ABuilder.PropSlashes(file);
|
|
|
|
if (!m_Cfg.ReadFromFile(file))
|
|
|
|
{
|
|
|
|
Console.WriteLine("Failed to read config, aborting!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ABuilder builder = null;
|
|
|
|
if ((int)System.Environment.OSVersion.Platform == 128)
|
|
|
|
{
|
|
|
|
builder = new LinuxBuilder();
|
2005-08-24 05:19:23 +00:00
|
|
|
Releaser.IsWindows = false;
|
2005-08-24 02:53:38 +00:00
|
|
|
} else {
|
|
|
|
builder = new Win32Builder();
|
2005-08-24 05:19:23 +00:00
|
|
|
Releaser.IsWindows = true;
|
2005-08-24 02:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Build build = new Build();
|
|
|
|
|
|
|
|
builder.Build(m_Cfg, build);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|