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:
		
							parent
							
								
									7a74c92167
								
							
						
					
					
						commit
						97d1660b34
					
				@ -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 bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public abstract string GetPawnCompilerName();
 | 
							public abstract string GetPawnCompilerName();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public bool CompilePlugin(Package pkg, Plugin pl)
 | 
							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;
 | 
								string filepath = null;
 | 
				
			||||||
			if (pl.Folder != null)
 | 
								if (pl.Folder != null)
 | 
				
			||||||
@ -48,7 +46,7 @@ namespace builder
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			Console.WriteLine(output);
 | 
								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))
 | 
								if (!File.Exists(binary))
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				return false;
 | 
									return false;
 | 
				
			||||||
@ -57,11 +55,11 @@ namespace builder
 | 
				
			|||||||
			string new_loc;
 | 
								string new_loc;
 | 
				
			||||||
			if (pl.disabled)
 | 
								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 
 | 
								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
 | 
								try
 | 
				
			||||||
@ -81,51 +79,13 @@ namespace builder
 | 
				
			|||||||
			return true;
 | 
								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)
 | 
							public bool CopyFile(Package pkg, string source, string dest)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			string from = Config.PathFormat("{0}/{1}", 
 | 
								string from = Config.PathFormat("{0}/{1}", 
 | 
				
			||||||
				cfg.SourceBase,
 | 
									cfg.source_path,
 | 
				
			||||||
				source);
 | 
									source);
 | 
				
			||||||
			string to = Config.PathFormat("{0}/{1}/{2}",
 | 
								string to = Config.PathFormat("{0}/{1}/{2}",
 | 
				
			||||||
				cfg.OutputBase,
 | 
									cfg.pkg_path,
 | 
				
			||||||
				pkg.GetBaseFolder(),
 | 
									pkg.GetBaseFolder(),
 | 
				
			||||||
				dest);
 | 
									dest);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -137,19 +97,19 @@ namespace builder
 | 
				
			|||||||
		/** dest can be null to mean root base folder */
 | 
							/** dest can be null to mean root base folder */
 | 
				
			||||||
		public void CopyFolder(Package pkg, string source, string dest, string [] omits)
 | 
							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;
 | 
								string to_base = null;
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			if (dest == null)
 | 
								if (dest == null)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				to_base = Config.PathFormat("{0}/{1}", 
 | 
									to_base = Config.PathFormat("{0}/{1}", 
 | 
				
			||||||
					cfg.OutputBase, 
 | 
										cfg.pkg_path, 
 | 
				
			||||||
					pkg.GetBaseFolder());
 | 
										pkg.GetBaseFolder());
 | 
				
			||||||
			} 
 | 
								} 
 | 
				
			||||||
			else 
 | 
								else 
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				to_base = Config.PathFormat("{0}/{1}/{2}", 
 | 
									to_base = Config.PathFormat("{0}/{1}/{2}", 
 | 
				
			||||||
					cfg.OutputBase, 
 | 
										cfg.pkg_path, 
 | 
				
			||||||
					pkg.GetBaseFolder(), 
 | 
										pkg.GetBaseFolder(), 
 | 
				
			||||||
					dest);
 | 
										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)
 | 
							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))
 | 
								if (!Directory.Exists(path))
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
@ -206,7 +155,7 @@ namespace builder
 | 
				
			|||||||
			string [] paths = pkg.GetFolders();
 | 
								string [] paths = pkg.GetFolders();
 | 
				
			||||||
			for (int i=0; i<paths.GetLength(0); i++)
 | 
								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))
 | 
									if (!Directory.Exists(path))
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					Directory.CreateDirectory(path);
 | 
										Directory.CreateDirectory(path);
 | 
				
			||||||
@ -225,15 +174,15 @@ namespace builder
 | 
				
			|||||||
				if (BuildLibrary(pkg, libs[i], ref bin, ref binpath))
 | 
									if (BuildLibrary(pkg, libs[i], ref bin, ref binpath))
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					path = Config.PathFormat("{0}/{1}/{2}/{3}",
 | 
										path = Config.PathFormat("{0}/{1}/{2}/{3}",
 | 
				
			||||||
						cfg.OutputBase,
 | 
											cfg.pkg_path,
 | 
				
			||||||
						pkg.GetBaseFolder(),
 | 
											pkg.GetBaseFolder(),
 | 
				
			||||||
						libs[i].Destination,
 | 
											libs[i].package_path,
 | 
				
			||||||
						bin);
 | 
											bin);
 | 
				
			||||||
					File.Copy(binpath, path, true);
 | 
										File.Copy(binpath, path, true);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				else 
 | 
									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);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -12,14 +12,10 @@ namespace builder
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	public class Config
 | 
						public class Config
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		public string SourceBase;
 | 
							public string source_path;
 | 
				
			||||||
		public string OutputBase;
 | 
							public string pkg_path;
 | 
				
			||||||
		public string BuilderPath;
 | 
							public string builder_path;
 | 
				
			||||||
		public string CompressOptions;
 | 
							public string build_options;
 | 
				
			||||||
		public string SVNVersion;
 | 
					 | 
				
			||||||
		public string ProductVersion;
 | 
					 | 
				
			||||||
		public string Compressor;
 | 
					 | 
				
			||||||
		public string BuildOptions;
 | 
					 | 
				
			||||||
		public builder.BasePlatform Platform;
 | 
							public builder.BasePlatform Platform;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public Config()
 | 
							public Config()
 | 
				
			||||||
@ -75,35 +71,19 @@ namespace builder
 | 
				
			|||||||
						val = val.Trim(delim.ToCharArray());
 | 
											val = val.Trim(delim.ToCharArray());
 | 
				
			||||||
						if (key.CompareTo("SourceBase") == 0)
 | 
											if (key.CompareTo("SourceBase") == 0)
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							SourceBase = val;
 | 
												source_path = val;
 | 
				
			||||||
						} 
 | 
											} 
 | 
				
			||||||
						else if (key.CompareTo("OutputBase") == 0) 
 | 
											else if (key.CompareTo("OutputBase") == 0) 
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							OutputBase = val;
 | 
												pkg_path = val;
 | 
				
			||||||
						} 
 | 
											} 
 | 
				
			||||||
						else if (key.CompareTo("BuilderPath") == 0) 
 | 
											else if (key.CompareTo("BuilderPath") == 0) 
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							BuilderPath = val;
 | 
												builder_path = 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;
 | 
					 | 
				
			||||||
						} 
 | 
											} 
 | 
				
			||||||
						else if (key.CompareTo("BuildOptions") == 0) 
 | 
											else if (key.CompareTo("BuildOptions") == 0) 
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							BuildOptions = val;
 | 
												build_options = val;
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
				
			|||||||
@ -16,52 +16,20 @@ namespace builder
 | 
				
			|||||||
			return "spcomp";
 | 
								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)
 | 
							public override bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			ProcessStartInfo info = new ProcessStartInfo();
 | 
								ProcessStartInfo info = new ProcessStartInfo();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			string path = Config.PathFormat("{0}/{1}", 
 | 
								string path = Config.PathFormat("{0}/{1}", 
 | 
				
			||||||
				cfg.SourceBase,
 | 
									cfg.source_path,
 | 
				
			||||||
				lib.LocalPath);
 | 
									lib.source_path);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/* PlatformExt ignored for us */
 | 
								/* 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";
 | 
										binName += "_i486.so";
 | 
				
			||||||
				} 
 | 
									} 
 | 
				
			||||||
@ -73,7 +41,7 @@ namespace builder
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			string binpath = Config.PathFormat("{0}/{1}/{2}",
 | 
								string binpath = Config.PathFormat("{0}/{1}/{2}",
 | 
				
			||||||
				path,
 | 
									path,
 | 
				
			||||||
				lib.ReleaseBuild,
 | 
									(lib.release_mode == ReleaseMode.ReleaseMode_Release) ? "Release" : "Debug",
 | 
				
			||||||
				binName);
 | 
									binName);
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			if (File.Exists(binpath))
 | 
								if (File.Exists(binpath))
 | 
				
			||||||
@ -81,10 +49,25 @@ namespace builder
 | 
				
			|||||||
				File.Delete(binpath);
 | 
									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 */
 | 
								/* Clean the project first */
 | 
				
			||||||
			info.WorkingDirectory = path;
 | 
								info.WorkingDirectory = path;
 | 
				
			||||||
			info.FileName = cfg.BuilderPath;
 | 
								info.FileName = cfg.builder_path;
 | 
				
			||||||
			info.Arguments = "clean";
 | 
								info.Arguments = "-f " + makefile_name + " clean";
 | 
				
			||||||
			info.UseShellExecute = false;
 | 
								info.UseShellExecute = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			Process p = Process.Start(info);
 | 
								Process p = Process.Start(info);
 | 
				
			||||||
@ -93,13 +76,13 @@ namespace builder
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			/* Now build it */
 | 
								/* Now build it */
 | 
				
			||||||
			info.WorkingDirectory = path;
 | 
								info.WorkingDirectory = path;
 | 
				
			||||||
			info.FileName = cfg.BuilderPath;
 | 
								info.FileName = cfg.builder_path;
 | 
				
			||||||
			info.Arguments = "";
 | 
								info.Arguments = "-f " + makefile_name;
 | 
				
			||||||
			info.UseShellExecute = false;
 | 
								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);
 | 
								p = Process.Start(info);
 | 
				
			||||||
 | 
				
			|||||||
@ -2,22 +2,37 @@ using System;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace builder
 | 
					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 class Library
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		public Library()
 | 
							public Library()
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			PlatformExt = false;
 | 
								has_platform_ext = false;
 | 
				
			||||||
			IsExecutable = false;
 | 
								is_executable = false;
 | 
				
			||||||
			ReleaseBuild = "Release";
 | 
								release_mode = ReleaseMode.ReleaseMode_Release;
 | 
				
			||||||
 | 
								build_mode = BuildMode.BuildMode_Simple;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		public string Name;			/* Name of binary */
 | 
							public string binary_name;		/* Name of binary */
 | 
				
			||||||
		public string LocalPath;	/* Local path to library build scripts */
 | 
							public string source_path;		/* Local path to library build scripts */
 | 
				
			||||||
		public string ReleaseBuild;	/* Release build name */
 | 
							public ReleaseMode release_mode; /* Release mode */
 | 
				
			||||||
		public string Destination;	/* Final relative path */
 | 
							public BuildMode build_mode;	/* Build mode */
 | 
				
			||||||
		public bool PlatformExt;	/* Extra platform extension */
 | 
							public string package_path;		/* Final relative path */
 | 
				
			||||||
		public string ProjectFile;	/* Project file, NULL for standard */
 | 
							public bool has_platform_ext;	/* Add extra platform extension? */
 | 
				
			||||||
		public bool IsExecutable;	/* If this is an EXE instead of a DLL */
 | 
							public string vcproj_name;		/* Project file, NULL for standard */
 | 
				
			||||||
		//string DebugBuild;		/* Debug build name */
 | 
							public bool is_executable;		/* If this is an EXE instead of a DLL */
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public class Plugin
 | 
						public class Plugin
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,14 @@
 | 
				
			|||||||
using System;
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace builder
 | 
					namespace builder
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	public class PkgCore : Package
 | 
						public class PkgCore : Package
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
							private ArrayList libraries;
 | 
				
			||||||
 | 
							private ArrayList plugins;
 | 
				
			||||||
 | 
							private ArrayList folders;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		public PkgCore()
 | 
							public PkgCore()
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@ -29,33 +34,37 @@ namespace builder
 | 
				
			|||||||
		 */
 | 
							 */
 | 
				
			||||||
		public override string [] GetFolders()
 | 
							public override string [] GetFolders()
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			string [] folders = new string[22];
 | 
								if (folders != null)
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									return (string [])folders.ToArray(typeof(string));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			folders[0] = "addons/sourcemod/bin";
 | 
								folders = new ArrayList();
 | 
				
			||||||
			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.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()
 | 
							public override Library [] GetLibraries()
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			Library [] libs = new Library[10];
 | 
								if (libraries != null)
 | 
				
			||||||
 | 
					 | 
				
			||||||
			for (int i=0; i<libs.Length; i++)
 | 
					 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				libs[i] = new Library();
 | 
									return (Library [])libraries.ToArray(typeof(Library));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			libs[0].Destination = "addons/sourcemod/bin";
 | 
								libraries = new ArrayList();
 | 
				
			||||||
			libs[0].LocalPath = "core";
 | 
					 | 
				
			||||||
			libs[0].Name = "sourcemod_mm";
 | 
					 | 
				
			||||||
			libs[0].PlatformExt = true;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			libs[1].Destination = "addons/sourcemod/bin";
 | 
								Library lib = new Library();
 | 
				
			||||||
			libs[1].LocalPath = "sourcepawn/jit/x86";
 | 
								lib.package_path = "addons/sourcemod/bin";
 | 
				
			||||||
			libs[1].Name = "sourcepawn.jit.x86";
 | 
								lib.source_path = "core";
 | 
				
			||||||
			libs[1].ProjectFile = "jit-x86";
 | 
								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";
 | 
								lib = new Library();
 | 
				
			||||||
			libs[2].LocalPath = "sourcepawn/compiler";
 | 
								lib.package_path = "addons/sourcemod/bin";
 | 
				
			||||||
			libs[2].Name = "spcomp";
 | 
								lib.source_path = "core";
 | 
				
			||||||
			libs[2].IsExecutable = true;
 | 
								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";
 | 
								lib = new Library();
 | 
				
			||||||
			libs[3].LocalPath = "extensions/geoip";
 | 
								lib.package_path = "addons/sourcemod/bin";
 | 
				
			||||||
			libs[3].Name = "geoip.ext";
 | 
								lib.source_path = "core";
 | 
				
			||||||
			libs[3].ProjectFile = "geoip";
 | 
								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";
 | 
								lib = new Library();
 | 
				
			||||||
			libs[4].LocalPath = "extensions/bintools";
 | 
								lib.package_path = "addons/sourcemod/bin";
 | 
				
			||||||
			libs[4].Name = "bintools.ext";
 | 
								lib.source_path = "sourcepawn/jit/x86";
 | 
				
			||||||
			libs[4].ProjectFile = "bintools";
 | 
								lib.binary_name = "sourcepawn.jit.x86";
 | 
				
			||||||
 | 
								lib.vcproj_name = "jit-x86";
 | 
				
			||||||
 | 
								libraries.Add(lib);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			libs[5].Destination = "addons/sourcemod/extensions";
 | 
								lib = new Library();
 | 
				
			||||||
			libs[5].LocalPath = "extensions/mysql";
 | 
								lib.package_path = "addons/sourcemod/scripting";
 | 
				
			||||||
			libs[5].Name = "dbi.mysql.ext";
 | 
								lib.source_path = "sourcepawn/compiler";
 | 
				
			||||||
			libs[5].ProjectFile = "sm_mysql";
 | 
								lib.binary_name = "spcomp";
 | 
				
			||||||
 | 
								lib.is_executable = true;
 | 
				
			||||||
 | 
								libraries.Add(lib);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			libs[6].Destination = "addons/sourcemod/extensions";
 | 
								lib = new Library();
 | 
				
			||||||
			libs[6].LocalPath = "extensions/sdktools";
 | 
								lib.package_path = "addons/sourcemod/extensions";
 | 
				
			||||||
			libs[6].Name = "sdktools.ext";
 | 
								lib.source_path = "extensions/geoip";
 | 
				
			||||||
			libs[6].ProjectFile = "sdktools";
 | 
								lib.binary_name = "geoip.ext";
 | 
				
			||||||
 | 
								lib.vcproj_name = "geoip";
 | 
				
			||||||
 | 
								libraries.Add(lib);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			libs[7].Destination = "addons/sourcemod/extensions";
 | 
								lib = new Library();
 | 
				
			||||||
			libs[7].LocalPath = "extensions/sqlite";
 | 
								lib.package_path = "addons/sourcemod/extensions";
 | 
				
			||||||
			libs[7].Name = "dbi.sqlite.ext";
 | 
								lib.source_path = "extensions/bintools";
 | 
				
			||||||
			libs[7].ProjectFile = "sm_sqlite";
 | 
								lib.binary_name = "bintools.ext";
 | 
				
			||||||
 | 
								lib.vcproj_name = "bintools";
 | 
				
			||||||
 | 
								libraries.Add(lib);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			libs[8].Destination = "addons/sourcemod/extensions/games";
 | 
								lib = new Library();
 | 
				
			||||||
			libs[8].LocalPath = "extensions/cstrike";
 | 
								lib.package_path = "addons/sourcemod/extensions";
 | 
				
			||||||
			libs[8].Name = "game.cstrike.ext";
 | 
								lib.source_path = "extensions/mysql";
 | 
				
			||||||
			libs[8].ProjectFile = "cstrike";
 | 
								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";
 | 
								lib = new Library();
 | 
				
			||||||
			libs[9].Name = "topmenus.ext";
 | 
								lib.Destination = "addons/sourcemod/extensions";
 | 
				
			||||||
			libs[9].ProjectFile = "topmenus";
 | 
								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()
 | 
							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 = new ArrayList();
 | 
				
			||||||
			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);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			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));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -16,51 +16,44 @@ namespace builder
 | 
				
			|||||||
			return "spcomp.exe";
 | 
								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)
 | 
							public override bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			ProcessStartInfo info = new ProcessStartInfo();
 | 
								ProcessStartInfo info = new ProcessStartInfo();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			string path = Config.PathFormat("{0}/{1}/msvc8", 
 | 
								string path = Config.PathFormat("{0}/{1}/msvc8", 
 | 
				
			||||||
				cfg.SourceBase,
 | 
									cfg.source_path,
 | 
				
			||||||
				lib.LocalPath);
 | 
									lib.source_path);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/* PlatformExt ignored for us */
 | 
								/* 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}",
 | 
								string binpath = Config.PathFormat("{0}/{1}/{2}",
 | 
				
			||||||
				path,
 | 
									path,
 | 
				
			||||||
				lib.ReleaseBuild,
 | 
									config_name,
 | 
				
			||||||
				binName);
 | 
									binName);
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			if (File.Exists(binpath))
 | 
								if (File.Exists(binpath))
 | 
				
			||||||
@ -68,28 +61,28 @@ namespace builder
 | 
				
			|||||||
				File.Delete(binpath);
 | 
									File.Delete(binpath);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			string projectFile = null;
 | 
								string project_file = null;
 | 
				
			||||||
			if (lib.ProjectFile != null)
 | 
								if (lib.vcproj_name != null)
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				projectFile = lib.ProjectFile + ".vcproj";
 | 
									project_file = lib.vcproj_name + ".vcproj";
 | 
				
			||||||
			} 
 | 
								} 
 | 
				
			||||||
			else 
 | 
								else 
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				projectFile = lib.Name + ".vcproj";
 | 
									project_file = lib.binary_name + ".vcproj";
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			info.WorkingDirectory = path;
 | 
								info.WorkingDirectory = path;
 | 
				
			||||||
			info.FileName = cfg.BuilderPath;
 | 
								info.FileName = cfg.builder_path;
 | 
				
			||||||
			info.UseShellExecute = false;
 | 
								info.UseShellExecute = false;
 | 
				
			||||||
			info.RedirectStandardOutput = true;
 | 
								info.RedirectStandardOutput = true;
 | 
				
			||||||
			info.RedirectStandardError = 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);
 | 
								Process p = Process.Start(info);
 | 
				
			||||||
			Console.WriteLine(p.StandardOutput.ReadToEnd());
 | 
								Console.WriteLine(p.StandardOutput.ReadToEnd());
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,3 @@
 | 
				
			|||||||
OutputBase = c:\real\done\sourcemod
 | 
					OutputBase = c:\real\done
 | 
				
			||||||
SourceBase = r:\sourcemod\trunk
 | 
					SourceBase = r:\sourcemod\trunk
 | 
				
			||||||
BuilderPath = C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.com
 | 
					BuilderPath = C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.com
 | 
				
			||||||
ProductVersion = 1.0.0
 | 
					 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user