ds@1952: using System; ds@1952: using System.IO; ds@1952: using System.Diagnostics; ds@1952: ds@1952: namespace builder ds@1952: { ds@1952: class Program ds@1952: { ds@1952: static void Main(string[] args) ds@1952: { ds@1952: if (args.GetLength(0) < 1) ds@1952: { ds@1952: System.Console.WriteLine("Usage: "); ds@1952: return; ds@1952: } ds@1952: ds@1952: Config cfg = new Config(); ds@1952: if (!cfg.ReadFromFile(args[0])) ds@1952: { ds@1952: return; ds@1952: } ds@1952: ds@1952: /* :TODO: Add path validation */ ds@1952: ds@1952: ABuilder bld = null; ds@1952: ds@1952: if (cfg.Platform == BasePlatform.Platform_Linux) ds@1952: { ds@1952: bld = new LinuxBuilder(cfg); ds@1952: } ds@1952: else if (cfg.Platform == BasePlatform.Platform_Windows) ds@1952: { ds@1952: bld = new Win32Builder(cfg); ds@1952: if (cfg.pdb_log_file != null && File.Exists(cfg.pdb_log_file)) ds@1952: { ds@1952: File.Delete(cfg.pdb_log_file); ds@1952: } ds@1952: } ds@1952: ds@1952: try ds@1952: { ds@1952: bld.BuildPackage(new PkgCore()); ds@1952: } ds@1952: catch (System.Exception e) ds@1952: { ds@1952: Console.WriteLine("Build failed: " + e.Message); ds@1952: } ds@1952: } ds@1952: } ds@1952: }