added real support for alternate building methods and orangebox packaging

refactored a lot of variable names, yuck
removed tons of legacy compressing/SVN code that's since handled by Perl

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401554
This commit is contained in:
David Anderson 2007-10-14 18:55:49 +00:00
parent 7a74c92167
commit 97d1660b34
7 changed files with 259 additions and 308 deletions

View File

@ -12,15 +12,13 @@ namespace builder
{
}
public abstract string CompressPackage(Package pkg);
public abstract bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath);
public abstract string GetPawnCompilerName();
public bool CompilePlugin(Package pkg, Plugin pl)
{
string local_dir = Config.PathFormat("{0}/{1}/addons/sourcemod/scripting", cfg.OutputBase, pkg.GetBaseFolder());
string local_dir = Config.PathFormat("{0}/{1}/addons/sourcemod/scripting", cfg.pkg_path, pkg.GetBaseFolder());
string filepath = null;
if (pl.Folder != null)
@ -48,7 +46,7 @@ namespace builder
Console.WriteLine(output);
string binary = Config.PathFormat("{0}/{1}/addons/sourcemod/scripting/{2}.smx", cfg.OutputBase, pkg.GetBaseFolder(), pl.Source);
string binary = Config.PathFormat("{0}/{1}/addons/sourcemod/scripting/{2}.smx", cfg.pkg_path, pkg.GetBaseFolder(), pl.Source);
if (!File.Exists(binary))
{
return false;
@ -57,11 +55,11 @@ namespace builder
string new_loc;
if (pl.disabled)
{
new_loc = Config.PathFormat("{0}/{1}/addons/sourcemod/plugins/disabled/{2}.smx", cfg.OutputBase, pkg.GetBaseFolder(), pl.Source);
new_loc = Config.PathFormat("{0}/{1}/addons/sourcemod/plugins/disabled/{2}.smx", cfg.pkg_path, pkg.GetBaseFolder(), pl.Source);
}
else
{
new_loc = Config.PathFormat("{0}/{1}/addons/sourcemod/plugins/{2}.smx", cfg.OutputBase, pkg.GetBaseFolder(), pl.Source);
new_loc = Config.PathFormat("{0}/{1}/addons/sourcemod/plugins/{2}.smx", cfg.pkg_path, pkg.GetBaseFolder(), pl.Source);
}
try
@ -81,51 +79,13 @@ namespace builder
return true;
}
public string GetRevsionOfPath(string path)
{
ProcessStartInfo info = new ProcessStartInfo();
info.WorkingDirectory = path;
info.FileName = cfg.SVNVersion;
info.Arguments = "--committed \"" + path + "\"";
info.UseShellExecute = false;
info.RedirectStandardOutput = true;
Process p = Process.Start(info);
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
string [] revs = output.Split(":".ToCharArray(), 2);
if (revs.Length < 1)
{
return null;
}
string rev = null;
if (revs.Length == 1)
{
rev = revs[0];
}
else
{
rev = revs[1];
}
rev = rev.Trim();
rev = rev.Replace("M", "");
rev = rev.Replace("S", "");
return rev;
}
public bool CopyFile(Package pkg, string source, string dest)
{
string from = Config.PathFormat("{0}/{1}",
cfg.SourceBase,
cfg.source_path,
source);
string to = Config.PathFormat("{0}/{1}/{2}",
cfg.OutputBase,
cfg.pkg_path,
pkg.GetBaseFolder(),
dest);
@ -137,19 +97,19 @@ namespace builder
/** dest can be null to mean root base folder */
public void CopyFolder(Package pkg, string source, string dest, string [] omits)
{
string from_base = Config.PathFormat("{0}/{1}", cfg.SourceBase, source);
string from_base = Config.PathFormat("{0}/{1}", cfg.source_path, source);
string to_base = null;
if (dest == null)
{
to_base = Config.PathFormat("{0}/{1}",
cfg.OutputBase,
cfg.pkg_path,
pkg.GetBaseFolder());
}
else
{
to_base = Config.PathFormat("{0}/{1}/{2}",
cfg.OutputBase,
cfg.pkg_path,
pkg.GetBaseFolder(),
dest);
}
@ -182,20 +142,9 @@ namespace builder
}
}
public string PackageBuildName(Package pkg)
{
return pkg.GetPackageName()
+ "-r"
+ GetRevsionOfPath(cfg.SourceBase)
+ "-"
+ DateTime.Now.Year
+ DateTime.Now.Month.ToString("00")
+ DateTime.Now.Day.ToString("00");
}
public void BuildPackage(Package pkg)
{
string path = Config.PathFormat("{0}/{1}", cfg.OutputBase, pkg.GetBaseFolder());
string path = Config.PathFormat("{0}/{1}", cfg.pkg_path, pkg.GetBaseFolder());
if (!Directory.Exists(path))
{
@ -206,7 +155,7 @@ namespace builder
string [] paths = pkg.GetFolders();
for (int i=0; i<paths.GetLength(0); i++)
{
path = Config.PathFormat("{0}/{1}/{2}", cfg.OutputBase, pkg.GetBaseFolder(), paths[i]);
path = Config.PathFormat("{0}/{1}/{2}", cfg.pkg_path, pkg.GetBaseFolder(), paths[i]);
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
@ -225,15 +174,15 @@ namespace builder
if (BuildLibrary(pkg, libs[i], ref bin, ref binpath))
{
path = Config.PathFormat("{0}/{1}/{2}/{3}",
cfg.OutputBase,
cfg.pkg_path,
pkg.GetBaseFolder(),
libs[i].Destination,
libs[i].package_path,
bin);
File.Copy(binpath, path, true);
}
else
{
throw new System.Exception("Failed to compile library: " + libs[i].Name);
throw new System.Exception("Failed to compile library: " + libs[i].binary_name);
}
}
@ -249,30 +198,6 @@ namespace builder
}
}
}
string pkg_file = null;
if (cfg.Compressor != null)
{
if ((pkg_file=CompressPackage(pkg)) == null)
{
throw new System.Exception("Failed to compress package: " + pkg.GetPackageName());
}
string lpath = null, ltarget = null;
pkg.GetCompressBases(ref lpath, ref ltarget);
lpath = Config.PathFormat("{0}/{1}/{2}",
cfg.OutputBase,
lpath,
pkg_file);
ltarget = Config.PathFormat("{0}/{1}", cfg.OutputBase, pkg_file);
if (File.Exists(ltarget))
{
File.Delete(ltarget);
}
File.Move(lpath, ltarget);
}
}
}
}

View File

@ -12,14 +12,10 @@ namespace builder
public class Config
{
public string SourceBase;
public string OutputBase;
public string BuilderPath;
public string CompressOptions;
public string SVNVersion;
public string ProductVersion;
public string Compressor;
public string BuildOptions;
public string source_path;
public string pkg_path;
public string builder_path;
public string build_options;
public builder.BasePlatform Platform;
public Config()
@ -75,35 +71,19 @@ namespace builder
val = val.Trim(delim.ToCharArray());
if (key.CompareTo("SourceBase") == 0)
{
SourceBase = val;
source_path = val;
}
else if (key.CompareTo("OutputBase") == 0)
{
OutputBase = val;
pkg_path = val;
}
else if (key.CompareTo("BuilderPath") == 0)
{
BuilderPath = val;
}
else if (key.CompareTo("CompressOptions") == 0)
{
CompressOptions = val;
}
else if (key.CompareTo("SVNVersion") == 0)
{
SVNVersion = val;
}
else if (key.CompareTo("ProductVersion") == 0)
{
ProductVersion = val;
}
else if (key.CompareTo("Compressor") == 0)
{
Compressor = val;
builder_path = val;
}
else if (key.CompareTo("BuildOptions") == 0)
{
BuildOptions = val;
build_options = val;
}
}
}

View File

@ -16,52 +16,20 @@ namespace builder
return "spcomp";
}
public override string CompressPackage(Package pkg)
{
string lpath = null, ltarget = null;
pkg.GetCompressBases(ref lpath, ref ltarget);
string local_dir = Config.PathFormat("{0}/{1}",
cfg.OutputBase,
lpath);
string name = PackageBuildName(pkg) + ".tar.gz";
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = cfg.Compressor;
info.WorkingDirectory = local_dir;
info.Arguments = "zcvf \"" + name + "\" \"" + ltarget + "\"";
info.UseShellExecute = false;
Process p = Process.Start(info);
p.WaitForExit();
local_dir = Config.PathFormat("{0}/{1}", local_dir, name);
if (!File.Exists(local_dir))
{
return null;
}
return name;
}
public override bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath)
{
ProcessStartInfo info = new ProcessStartInfo();
string path = Config.PathFormat("{0}/{1}",
cfg.SourceBase,
lib.LocalPath);
cfg.source_path,
lib.source_path);
/* PlatformExt ignored for us */
string binName = lib.Name;
string binName = lib.binary_name;
if (!lib.IsExecutable)
if (!lib.is_executable)
{
if (lib.PlatformExt)
if (lib.has_platform_ext)
{
binName += "_i486.so";
}
@ -73,7 +41,7 @@ namespace builder
string binpath = Config.PathFormat("{0}/{1}/{2}",
path,
lib.ReleaseBuild,
(lib.release_mode == ReleaseMode.ReleaseMode_Release) ? "Release" : "Debug",
binName);
if (File.Exists(binpath))
@ -81,10 +49,25 @@ namespace builder
File.Delete(binpath);
}
string makefile_name = "Makefile";
if (lib.build_mode == BuildMode.BuildMode_Episode1)
{
makefile_name = "Makefile.ep1";
}
else if (lib.build_mode == BuildMode.BuildMode_Episode2)
{
makefile_name = "Makefile.ep2";
}
else if (lib.build_mode == BuildMode.BuildMode_OldMetamod)
{
makefile_name = "Makefile.orig";
}
/* Clean the project first */
info.WorkingDirectory = path;
info.FileName = cfg.BuilderPath;
info.Arguments = "clean";
info.FileName = cfg.builder_path;
info.Arguments = "-f " + makefile_name + " clean";
info.UseShellExecute = false;
Process p = Process.Start(info);
@ -93,13 +76,13 @@ namespace builder
/* Now build it */
info.WorkingDirectory = path;
info.FileName = cfg.BuilderPath;
info.Arguments = "";
info.FileName = cfg.builder_path;
info.Arguments = "-f " + makefile_name;
info.UseShellExecute = false;
if (cfg.BuildOptions != null)
if (cfg.build_options != null)
{
info.Arguments += " " + cfg.BuildOptions;
info.Arguments += " " + cfg.build_options;
}
p = Process.Start(info);

View File

@ -2,22 +2,37 @@ using System;
namespace builder
{
public enum ReleaseMode : int
{
ReleaseMode_Release,
ReleaseMode_Debug,
};
public enum BuildMode : int
{
BuildMode_Simple,
BuildMode_OldMetamod,
BuildMode_Episode1,
BuildMode_Episode2
};
public class Library
{
public Library()
{
PlatformExt = false;
IsExecutable = false;
ReleaseBuild = "Release";
has_platform_ext = false;
is_executable = false;
release_mode = ReleaseMode.ReleaseMode_Release;
build_mode = BuildMode.BuildMode_Simple;
}
public string Name; /* Name of binary */
public string LocalPath; /* Local path to library build scripts */
public string ReleaseBuild; /* Release build name */
public string Destination; /* Final relative path */
public bool PlatformExt; /* Extra platform extension */
public string ProjectFile; /* Project file, NULL for standard */
public bool IsExecutable; /* If this is an EXE instead of a DLL */
//string DebugBuild; /* Debug build name */
public string binary_name; /* Name of binary */
public string source_path; /* Local path to library build scripts */
public ReleaseMode release_mode; /* Release mode */
public BuildMode build_mode; /* Build mode */
public string package_path; /* Final relative path */
public bool has_platform_ext; /* Add extra platform extension? */
public string vcproj_name; /* Project file, NULL for standard */
public bool is_executable; /* If this is an EXE instead of a DLL */
};
public class Plugin

View File

@ -1,9 +1,14 @@
using System;
using System.Collections;
namespace builder
{
public class PkgCore : Package
{
private ArrayList libraries;
private ArrayList plugins;
private ArrayList folders;
public PkgCore()
{
}
@ -29,33 +34,37 @@ namespace builder
*/
public override string [] GetFolders()
{
string [] folders = new string[22];
if (folders != null)
{
return (string [])folders.ToArray(typeof(string));
}
folders[0] = "addons/sourcemod/bin";
folders[1] = "addons/sourcemod/plugins/disabled";
folders[2] = "addons/sourcemod/gamedata";
folders[3] = "addons/sourcemod/configs/geoip";
folders[4] = "addons/sourcemod/translations";
folders[5] = "addons/sourcemod/logs";
folders[6] = "addons/sourcemod/extensions";
folders[7] = "addons/sourcemod/data";
folders[8] = "addons/sourcemod/scripting/include";
folders[9] = "addons/sourcemod/scripting/admin-flatfile";
folders[10] = "addons/sourcemod/scripting/testsuite";
folders[11] = "cfg/sourcemod";
folders[12] = "addons/sourcemod/configs/sql-init-scripts";
folders[13] = "addons/sourcemod/configs/sql-init-scripts/mysql";
folders[14] = "addons/sourcemod/configs/sql-init-scripts/sqlite";
folders[15] = "addons/sourcemod/extensions/games";
folders[16] = "addons/sourcemod/scripting/basecommands";
folders[17] = "addons/sourcemod/scripting/basecomm";
folders[18] = "addons/sourcemod/scripting/basefunvotes";
folders[19] = "addons/sourcemod/scripting/basevotes";
folders[20] = "addons/sourcemod/scripting/basebans";
folders[21] = "addons/sourcemod/scripting/basefuncommands";
folders = new ArrayList();
folders.Add("addons/sourcemod/bin");
folders.Add("addons/sourcemod/plugins/disabled");
folders.Add("addons/sourcemod/gamedata");
folders.Add("addons/sourcemod/configs/geoip");
folders.Add("addons/sourcemod/translations");
folders.Add("addons/sourcemod/logs");
folders.Add("addons/sourcemod/extensions");
folders.Add("addons/sourcemod/data");
folders.Add("addons/sourcemod/scripting/include");
folders.Add("addons/sourcemod/scripting/admin-flatfile");
folders.Add("addons/sourcemod/scripting/testsuite");
folders.Add("cfg/sourcemod");
folders.Add("addons/sourcemod/configs/sql-init-scripts");
folders.Add("addons/sourcemod/configs/sql-init-scripts/mysql");
folders.Add("addons/sourcemod/configs/sql-init-scripts/sqlite");
folders.Add("addons/sourcemod/extensions/games");
folders.Add("addons/sourcemod/scripting/basecommands");
folders.Add("addons/sourcemod/scripting/basecomm");
folders.Add("addons/sourcemod/scripting/basefunvotes");
folders.Add("addons/sourcemod/scripting/basevotes");
folders.Add("addons/sourcemod/scripting/basebans");
folders.Add("addons/sourcemod/scripting/basefuncommands");
return folders;
return (string [])folders.ToArray(typeof(string));
}
/**
@ -113,64 +122,105 @@ namespace builder
*/
public override Library [] GetLibraries()
{
Library [] libs = new Library[10];
for (int i=0; i<libs.Length; i++)
if (libraries != null)
{
libs[i] = new Library();
return (Library [])libraries.ToArray(typeof(Library));
}
libs[0].Destination = "addons/sourcemod/bin";
libs[0].LocalPath = "core";
libs[0].Name = "sourcemod_mm";
libs[0].PlatformExt = true;
libraries = new ArrayList();
libs[1].Destination = "addons/sourcemod/bin";
libs[1].LocalPath = "sourcepawn/jit/x86";
libs[1].Name = "sourcepawn.jit.x86";
libs[1].ProjectFile = "jit-x86";
Library lib = new Library();
lib.package_path = "addons/sourcemod/bin";
lib.source_path = "core";
lib.binary_name = "sourcemod.1.ep1";
lib.vcproj_name = "sourcemod_mm";
lib.build_mode = BuildMode.BuildMode_OldMetamod;
libraries.Add(lib);
libs[2].Destination = "addons/sourcemod/scripting";
libs[2].LocalPath = "sourcepawn/compiler";
libs[2].Name = "spcomp";
libs[2].IsExecutable = true;
lib = new Library();
lib.package_path = "addons/sourcemod/bin";
lib.source_path = "core";
lib.binary_name = "sourcemod.2.ep1";
lib.vcproj_name = "sourcemod_mm";
lib.build_mode = BuildMode.BuildMode_Episode1;
libraries.Add(lib);
libs[3].Destination = "addons/sourcemod/extensions";
libs[3].LocalPath = "extensions/geoip";
libs[3].Name = "geoip.ext";
libs[3].ProjectFile = "geoip";
lib = new Library();
lib.package_path = "addons/sourcemod/bin";
lib.source_path = "core";
lib.binary_name = "sourcemod.2.ep2";
lib.vcproj_name = "sourcemod_mm";
lib.build_mode = BuildMode.BuildMode_Episode2;
libraries.Add(lib);
libs[4].Destination = "addons/sourcemod/extensions";
libs[4].LocalPath = "extensions/bintools";
libs[4].Name = "bintools.ext";
libs[4].ProjectFile = "bintools";
lib = new Library();
lib.package_path = "addons/sourcemod/bin";
lib.source_path = "sourcepawn/jit/x86";
lib.binary_name = "sourcepawn.jit.x86";
lib.vcproj_name = "jit-x86";
libraries.Add(lib);
libs[5].Destination = "addons/sourcemod/extensions";
libs[5].LocalPath = "extensions/mysql";
libs[5].Name = "dbi.mysql.ext";
libs[5].ProjectFile = "sm_mysql";
lib = new Library();
lib.package_path = "addons/sourcemod/scripting";
lib.source_path = "sourcepawn/compiler";
lib.binary_name = "spcomp";
lib.is_executable = true;
libraries.Add(lib);
libs[6].Destination = "addons/sourcemod/extensions";
libs[6].LocalPath = "extensions/sdktools";
libs[6].Name = "sdktools.ext";
libs[6].ProjectFile = "sdktools";
lib = new Library();
lib.package_path = "addons/sourcemod/extensions";
lib.source_path = "extensions/geoip";
lib.binary_name = "geoip.ext";
lib.vcproj_name = "geoip";
libraries.Add(lib);
libs[7].Destination = "addons/sourcemod/extensions";
libs[7].LocalPath = "extensions/sqlite";
libs[7].Name = "dbi.sqlite.ext";
libs[7].ProjectFile = "sm_sqlite";
lib = new Library();
lib.package_path = "addons/sourcemod/extensions";
lib.source_path = "extensions/bintools";
lib.binary_name = "bintools.ext";
lib.vcproj_name = "bintools";
libraries.Add(lib);
libs[8].Destination = "addons/sourcemod/extensions/games";
libs[8].LocalPath = "extensions/cstrike";
libs[8].Name = "game.cstrike.ext";
libs[8].ProjectFile = "cstrike";
lib = new Library();
lib.package_path = "addons/sourcemod/extensions";
lib.source_path = "extensions/mysql";
lib.binary_name = "dbi.mysql.ext";
lib.vcproj_name = "sm_mysql";
libraries.Add(lib);
libs[9].Destination = "addons/sourcemod/extensions";
libs[9].LocalPath = "extensions/topmenus";
libs[9].Name = "topmenus.ext";
libs[9].ProjectFile = "topmenus";
/*
lib = new Library();
lib.Destination = "addons/sourcemod/extensions";
lib.LocalPath = "extensions/sdktools";
lib.Name = "sdktools.ext";
lib.ProjectFile = "sdktools";
libraries.Add(lib);
*/
return libs;
lib = new Library();
lib.package_path = "addons/sourcemod/extensions";
lib.source_path = "extensions/sqlite";
lib.binary_name = "dbi.sqlite.ext";
lib.vcproj_name = "sm_sqlite";
libraries.Add(lib);
/*
lib = new Library();
lib.Destination = "addons/sourcemod/extensions/games";
lib.LocalPath = "extensions/cstrike";
lib.Name = "game.cstrike.ext";
lib.ProjectFile = "cstrike";
libraries.Add(lib);
*/
lib = new Library();
lib.package_path = "addons/sourcemod/extensions";
lib.source_path = "extensions/topmenus";
lib.binary_name = "topmenus.ext";
lib.vcproj_name = "topmenus";
libraries.Add(lib);
return (Library [])libraries.ToArray(typeof(Library));
}
/**
@ -178,29 +228,35 @@ namespace builder
*/
public override Plugin [] GetPlugins()
{
Plugin [] plugins = new Plugin[19];
if (plugins != null)
{
return (Plugin [])plugins.ToArray(typeof(Plugin));
}
plugins[0] = new Plugin("admin-flatfile", "admin-flatfile");
plugins[1] = new Plugin("adminhelp");
plugins[2] = new Plugin("antiflood");
plugins[3] = new Plugin("basecommands");
plugins[4] = new Plugin("reservedslots");
plugins[5] = new Plugin("basetriggers");
plugins[6] = new Plugin("nextmap");
plugins[7] = new Plugin("basechat");
plugins[8] = new Plugin("basefuncommands");
plugins[9] = new Plugin("basevotes");
plugins[10] = new Plugin("basefunvotes");
plugins[11] = new Plugin("admin-sql-prefetch", true);
plugins[12] = new Plugin("admin-sql-threaded", true);
plugins[13] = new Plugin("sql-admin-manager", true);
plugins[14] = new Plugin("basebans");
plugins[15] = new Plugin("mapchooser", true);
plugins[16] = new Plugin("basecomm");
plugins[17] = new Plugin("randomcycle", true);
plugins[18] = new Plugin("rockthevote", true);
plugins = new ArrayList();
return plugins;
plugins.Add(new Plugin("admin-flatfile", "admin-flatfile"));
plugins.Add(new Plugin("adminhelp"));
plugins.Add(new Plugin("antiflood"));
plugins.Add(new Plugin("basecommands"));
plugins.Add(new Plugin("reservedslots"));
plugins.Add(new Plugin("basetriggers"));
plugins.Add(new Plugin("nextmap"));
plugins.Add(new Plugin("basechat"));
plugins.Add(new Plugin("basefuncommands"));
plugins.Add(new Plugin("basevotes"));
plugins.Add(new Plugin("basefunvotes"));
plugins.Add(new Plugin("admin-sql-prefetch", true));
plugins.Add(new Plugin("admin-sql-threaded", true));
plugins.Add(new Plugin("sql-admin-manager", true));
plugins.Add(new Plugin("basebans"));
plugins.Add(new Plugin("mapchooser", true));
plugins.Add(new Plugin("basecomm"));
plugins.Add(new Plugin("randomcycle", true));
plugins.Add(new Plugin("rockthevote", true));
plugins.Add(new Plugin("adminmenu", true));
return (Plugin [])plugins.ToArray(typeof(Plugin));
}
}
}

View File

@ -16,51 +16,44 @@ namespace builder
return "spcomp.exe";
}
public override string CompressPackage(Package pkg)
{
string lpath = null, ltarget = null;
pkg.GetCompressBases(ref lpath, ref ltarget);
string local_dir = Config.PathFormat("{0}/{1}",
cfg.OutputBase,
lpath);
string name = PackageBuildName(pkg) + ".zip";
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = cfg.Compressor;
info.WorkingDirectory = local_dir;
info.Arguments = "-r \"" + name + "\" \"" + ltarget + "\"";
info.UseShellExecute = false;
Process p = Process.Start(info);
p.WaitForExit();
local_dir = Config.PathFormat("{0}/{1}", local_dir, name);
if (!File.Exists(local_dir))
{
return null;
}
return name;
}
public override bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath)
{
ProcessStartInfo info = new ProcessStartInfo();
string path = Config.PathFormat("{0}/{1}/msvc8",
cfg.SourceBase,
lib.LocalPath);
cfg.source_path,
lib.source_path);
/* PlatformExt ignored for us */
string binName = lib.Name + (lib.IsExecutable ? ".exe" : ".dll");
string binName = lib.binary_name + (lib.is_executable ? ".exe" : ".dll");
string config_name = "Unknown";
if (lib.release_mode == ReleaseMode.ReleaseMode_Release)
{
config_name = "Release";
}
else if (lib.release_mode == ReleaseMode.ReleaseMode_Debug)
{
config_name = "Debug";
}
if (lib.build_mode == BuildMode.BuildMode_Episode1)
{
config_name = config_name + " - Episode 1";
}
else if (lib.build_mode == BuildMode.BuildMode_Episode2)
{
config_name = config_name + " - Orange Box";
}
else if (lib.build_mode == BuildMode.BuildMode_OldMetamod)
{
config_name = config_name + " - Old Metamod";
}
string binpath = Config.PathFormat("{0}/{1}/{2}",
path,
lib.ReleaseBuild,
config_name,
binName);
if (File.Exists(binpath))
@ -68,28 +61,28 @@ namespace builder
File.Delete(binpath);
}
string projectFile = null;
if (lib.ProjectFile != null)
string project_file = null;
if (lib.vcproj_name != null)
{
projectFile = lib.ProjectFile + ".vcproj";
project_file = lib.vcproj_name + ".vcproj";
}
else
{
projectFile = lib.Name + ".vcproj";
project_file = lib.binary_name + ".vcproj";
}
info.WorkingDirectory = path;
info.FileName = cfg.BuilderPath;
info.FileName = cfg.builder_path;
info.UseShellExecute = false;
info.RedirectStandardOutput = true;
info.RedirectStandardError = true;
if (cfg.BuildOptions != null)
if (cfg.build_options != null)
{
info.Arguments = cfg.BuildOptions + " ";
info.Arguments = cfg.build_options + " ";
}
info.Arguments += "/rebuild " + lib.ReleaseBuild + " " + projectFile;
info.Arguments += "/rebuild \"" + config_name + "\" " + project_file;
Process p = Process.Start(info);
Console.WriteLine(p.StandardOutput.ReadToEnd());

View File

@ -1,4 +1,3 @@
OutputBase = c:\real\done\sourcemod
OutputBase = c:\real\done
SourceBase = r:\sourcemod\trunk
BuilderPath = C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.com
ProductVersion = 1.0.0