tools/builder/PkgCore.cs
author Borja Ferrer <faluco@alliedmods.net>
Thu May 10 22:51:56 2007 +0000 (2007-05-10)
changeset 762 e82fc0f89dc1
parent 746 b02765482bd3
child 807 5bd52de83f31
permissions -rw-r--r--
added debug code for leak detection on plugins
     1 using System;
     2 
     3 namespace builder
     4 {
     5 	public class PkgCore : Package
     6 	{
     7 		public PkgCore()
     8 		{
     9 		}
    10 
    11 		public override string GetBaseFolder()
    12 		{
    13 			return "base/addons/sourcemod";
    14 		}
    15 
    16 		public override void GetCompressBases(ref string path, ref string folder)
    17 		{
    18 			path = "base";
    19 			folder = "addons";
    20 		}
    21 
    22 		public override string GetPackageName()
    23 		{
    24 			return "sourcemod-core";
    25 		}
    26 
    27 		/** 
    28 		 * Must return the list of folders to create.
    29 		 */
    30 		public override string [] GetFolders()
    31 		{
    32 			string [] folders = new string[8];
    33 
    34 			folders[0] = "bin";
    35 			folders[1] = "plugins/disabled";
    36 			folders[2] = "configs/gamedata";
    37 			folders[3] = "translations";
    38 			folders[4] = "logs";
    39 			folders[5] = "extensions";
    40 			folders[6] = "scripting/include";
    41 			folders[7] = "data";
    42 
    43 			return folders;
    44 		}
    45 
    46 		/**
    47 		 * Called when file to file copies must be performed
    48 		 */
    49 		public override void OnCopyFiles(ABuilder builder)
    50 		{
    51 		}
    52 
    53 		/**
    54 		 * Called when dir to dir copies must be performed
    55 		 */
    56 		public override void OnCopyFolders(ABuilder builder)
    57 		{
    58 			builder.CopyFolder(this, "configs", "configs", null);
    59 			builder.CopyFolder(this, "configs/gamedata", "configs/gamedata", null);
    60 			
    61 			string [] plugin_omits = new string[1];
    62 			plugin_omits[0] = "spcomp.exe";
    63 
    64 			string [] include_omits = new string[1];
    65 			include_omits[0] = "version.tpl";
    66 
    67 			builder.CopyFolder(this, "plugins", "scripting", plugin_omits);
    68 			builder.CopyFolder(this, "plugins/include", "scripting/include", include_omits);
    69 			builder.CopyFolder(this, "translations", "translations", null);
    70 			builder.CopyFolder(this, "public/licenses", null, null);
    71 		}
    72 
    73 		/**
    74 		 * Called to build libraries
    75 		 */
    76 		public override Library [] GetLibraries()
    77 		{
    78 			Library [] libs = new Library[5];
    79 
    80 			for (int i=0; i<libs.Length; i++)
    81 			{
    82 				libs[i] = new Library();
    83 			}
    84 
    85 			libs[0].Destination = "bin";
    86 			libs[0].LocalPath = "core";
    87 			libs[0].Name = "sourcemod_mm";
    88 			libs[0].PlatformExt = true;
    89 
    90 			libs[1].Destination = "bin";
    91 			libs[1].LocalPath = "sourcepawn/jit/x86";
    92 			libs[1].Name = "sourcepawn.jit.x86";
    93 			libs[1].ProjectFile = "jit-x86";
    94 
    95 			libs[2].Destination = "scripting";
    96 			libs[2].LocalPath = "sourcepawn/compiler";
    97 			libs[2].Name = "spcomp";
    98 			libs[2].IsExecutable = true;
    99 
   100 			libs[3].Destination = "extensions";
   101 			libs[3].LocalPath = "extensions/geoip";
   102 			libs[3].Name = "geoip.ext";
   103 			libs[3].ProjectFile = "geoip";
   104 
   105 			libs[4].Destination = "extensions";
   106 			libs[4].LocalPath = "extensions/threader";
   107 			libs[4].Name = "threader.ext";
   108 			libs[4].ProjectFile = "threader";
   109 
   110 			return libs;
   111 		}
   112 	}
   113 }
   114