tools/builder/Main.cs
author Scott Ehlert <ds@alliedmods.net>
Tue May 13 08:22:49 2008 +0000 (2008-05-13)
changeset 2051 568678a2e847
parent 1952 b7aa2b626807
child 2256 de422b59bdfc
permissions -rw-r--r--
Trunk build fixes
Fixed up IGameHelpers.h such that it no longer requires HL2SDK headers if a function doesn't need them
     1 using System;
     2 using System.IO;
     3 using System.Diagnostics;
     4 
     5 namespace builder
     6 {
     7 	class Program
     8 	{
     9 		static void Main(string[] args)
    10 		{
    11 			if (args.GetLength(0) < 1)
    12 			{
    13 				System.Console.WriteLine("Usage: <config file>");
    14 				return;
    15 			}
    16 
    17 			Config cfg = new Config();
    18 			if (!cfg.ReadFromFile(args[0]))
    19 			{
    20 				return;
    21 			}
    22 
    23 			/* :TODO: Add path validation */
    24 
    25 			ABuilder bld = null;
    26 			
    27 			if (cfg.Platform == BasePlatform.Platform_Linux)
    28 			{
    29 				bld = new LinuxBuilder(cfg);
    30 			} 
    31 			else if (cfg.Platform == BasePlatform.Platform_Windows)
    32 			{
    33 				bld = new Win32Builder(cfg);
    34 				if (cfg.pdb_log_file != null && File.Exists(cfg.pdb_log_file))
    35 				{
    36 					File.Delete(cfg.pdb_log_file);
    37 				}
    38 			}
    39 
    40 			try
    41 			{
    42 				bld.BuildPackage(new PkgCore());
    43 			} 
    44 			catch (System.Exception e) 
    45 			{
    46 				Console.WriteLine("Build failed: " + e.Message);
    47 			}
    48 		}
    49 	}
    50 }