tools/builder/Main.cs
author David Anderson <dvander@alliedmods.net>
Fri Jun 08 01:09:17 2007 +0000 (2007-06-08)
changeset 922 980941c525fa
parent 686 b3f80b9ced9e
child 1816 269bbfbfbcac
permissions -rw-r--r--
sm_kick now uses targeting properly
     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 			}
    35 
    36 			try
    37 			{
    38 				bld.BuildPackage(new PkgCore());
    39 			} 
    40 			catch (System.Exception e) 
    41 			{
    42 				Console.WriteLine("Build failed: " + e.Message);
    43 			}
    44 		}
    45 	}
    46 }