tools/builder/Win32Builder.cs
changeset 1548 e759eedf6c9b
parent 852 9a7a93363979
child 1558 95a3d8bf618d
     1.1 --- a/tools/builder/Win32Builder.cs	Sun Oct 14 18:53:29 2007 +0000
     1.2 +++ b/tools/builder/Win32Builder.cs	Sun Oct 14 18:55:49 2007 +0000
     1.3 @@ -16,51 +16,44 @@
     1.4  			return "spcomp.exe";
     1.5  		}
     1.6  
     1.7 -		public override string CompressPackage(Package pkg)
     1.8 -		{
     1.9 -			string lpath = null, ltarget = null;
    1.10 -			
    1.11 -			pkg.GetCompressBases(ref lpath, ref ltarget);
    1.12 -
    1.13 -			string local_dir = Config.PathFormat("{0}/{1}", 
    1.14 -				cfg.OutputBase,
    1.15 -				lpath);
    1.16 -
    1.17 -			string name = PackageBuildName(pkg) + ".zip";
    1.18 -
    1.19 -			ProcessStartInfo info = new ProcessStartInfo();
    1.20 -			info.FileName = cfg.Compressor;
    1.21 -			info.WorkingDirectory = local_dir;
    1.22 -			info.Arguments = "-r \"" + name + "\" \"" + ltarget + "\"";
    1.23 -			info.UseShellExecute = false;
    1.24 -
    1.25 -			Process p = Process.Start(info);
    1.26 -			p.WaitForExit();
    1.27 -
    1.28 -			local_dir = Config.PathFormat("{0}/{1}", local_dir, name);
    1.29 -
    1.30 -			if (!File.Exists(local_dir))
    1.31 -			{
    1.32 -				return null;
    1.33 -			}
    1.34 -
    1.35 -			return name;
    1.36 -		}
    1.37 -
    1.38  		public override bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath)
    1.39  		{
    1.40  			ProcessStartInfo info = new ProcessStartInfo();
    1.41  
    1.42  			string path = Config.PathFormat("{0}/{1}/msvc8", 
    1.43 -				cfg.SourceBase,
    1.44 -				lib.LocalPath);
    1.45 +				cfg.source_path,
    1.46 +				lib.source_path);
    1.47  
    1.48  			/* PlatformExt ignored for us */
    1.49 -			string binName = lib.Name + (lib.IsExecutable ? ".exe" : ".dll");
    1.50 +			string binName = lib.binary_name + (lib.is_executable ? ".exe" : ".dll");
    1.51 +
    1.52 +			string config_name = "Unknown";
    1.53 +
    1.54 +			if (lib.release_mode == ReleaseMode.ReleaseMode_Release)
    1.55 +			{
    1.56 +				config_name = "Release";
    1.57 +			}
    1.58 +			else if (lib.release_mode == ReleaseMode.ReleaseMode_Debug)
    1.59 +			{
    1.60 +				config_name = "Debug";
    1.61 +			}
    1.62 +
    1.63 +			if (lib.build_mode == BuildMode.BuildMode_Episode1)
    1.64 +			{
    1.65 +				config_name = config_name + " - Episode 1";
    1.66 +			}
    1.67 +			else if (lib.build_mode == BuildMode.BuildMode_Episode2)
    1.68 +			{
    1.69 +				config_name = config_name + " - Orange Box";
    1.70 +			}
    1.71 +			else if (lib.build_mode == BuildMode.BuildMode_OldMetamod)
    1.72 +			{
    1.73 +				config_name = config_name + " - Old Metamod";
    1.74 +			}
    1.75  
    1.76  			string binpath = Config.PathFormat("{0}/{1}/{2}",
    1.77  				path,
    1.78 -				lib.ReleaseBuild,
    1.79 +				config_name,
    1.80  				binName);
    1.81  			
    1.82  			if (File.Exists(binpath))
    1.83 @@ -68,28 +61,28 @@
    1.84  				File.Delete(binpath);
    1.85  			}
    1.86  
    1.87 -			string projectFile = null;
    1.88 -			if (lib.ProjectFile != null)
    1.89 +			string project_file = null;
    1.90 +			if (lib.vcproj_name != null)
    1.91  			{
    1.92 -				projectFile = lib.ProjectFile + ".vcproj";
    1.93 +				project_file = lib.vcproj_name + ".vcproj";
    1.94  			} 
    1.95  			else 
    1.96  			{
    1.97 -				projectFile = lib.Name + ".vcproj";
    1.98 +				project_file = lib.binary_name + ".vcproj";
    1.99  			}
   1.100  
   1.101  			info.WorkingDirectory = path;
   1.102 -			info.FileName = cfg.BuilderPath;
   1.103 +			info.FileName = cfg.builder_path;
   1.104  			info.UseShellExecute = false;
   1.105  			info.RedirectStandardOutput = true;
   1.106  			info.RedirectStandardError = true;
   1.107  
   1.108 -			if (cfg.BuildOptions != null)
   1.109 +			if (cfg.build_options != null)
   1.110  			{
   1.111 -				info.Arguments = cfg.BuildOptions + " ";
   1.112 +				info.Arguments = cfg.build_options + " ";
   1.113  			}
   1.114  
   1.115 -			info.Arguments += "/rebuild " + lib.ReleaseBuild + " " + projectFile;
   1.116 +			info.Arguments += "/rebuild \"" + config_name + "\" " + project_file;
   1.117  
   1.118  			Process p = Process.Start(info);
   1.119  			Console.WriteLine(p.StandardOutput.ReadToEnd());