tools/builder/PkgCore.cs
author David Anderson <dvander@alliedmods.net>
Sat Jun 16 18:34:20 2007 +0000 (2007-06-16)
changeset 957 ca0c77d7f91f
parent 952 f2cdc085139e
child 984 c996eafa2d16
permissions -rw-r--r--
added sdktools to build script
     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[11];
    33 
    34 			folders[0] = "bin";
    35 			folders[1] = "plugins/disabled";
    36 			folders[2] = "gamedata";
    37 			folders[3] = "configs/geoip";
    38 			folders[4] = "translations";
    39 			folders[5] = "logs";
    40 			folders[6] = "extensions";
    41 			folders[7] = "data";
    42 			folders[8] = "scripting/include";
    43 			folders[9] = "scripting/admin-flatfile";
    44 			folders[10] = "scripting/testsuite";
    45 
    46 			return folders;
    47 		}
    48 
    49 		/**
    50 		 * Called when file to file copies must be performed
    51 		 */
    52 		public override void OnCopyFiles(ABuilder builder)
    53 		{
    54 		}
    55 
    56 		/**
    57 		 * Called when dir to dir copies must be performed
    58 		 */
    59 		public override void OnCopyFolders(ABuilder builder)
    60 		{
    61 			builder.CopyFolder(this, "configs", "configs", null);
    62 			builder.CopyFolder(this, "configs/geoip", "configs/geoip", null);
    63 			
    64 			string [] plugin_omits = new string[1];
    65 			plugin_omits[0] = "spcomp.exe";
    66 
    67 			string [] include_omits = new string[1];
    68 			include_omits[0] = "version.tpl";
    69 
    70 			builder.CopyFolder(this, "gamedata", "gamedata", null);
    71 			builder.CopyFolder(this, "plugins", "scripting", plugin_omits);
    72 			builder.CopyFolder(this, "plugins/include", "scripting/include", include_omits);
    73 			builder.CopyFolder(this, "translations", "translations", null);
    74 			builder.CopyFolder(this, "public/licenses", null, null);
    75 			builder.CopyFolder(this, "plugins/admin-flatfile", "scripting/admin-flatfile", null);
    76 			builder.CopyFolder(this, "plugins/testsuite", "scripting/testsuite", null);
    77 		}
    78 
    79 		/**
    80 		 * Called to build libraries
    81 		 */
    82 		public override Library [] GetLibraries()
    83 		{
    84 			Library [] libs = new Library[7];
    85 
    86 			for (int i=0; i<libs.Length; i++)
    87 			{
    88 				libs[i] = new Library();
    89 			}
    90 
    91 			libs[0].Destination = "bin";
    92 			libs[0].LocalPath = "core";
    93 			libs[0].Name = "sourcemod_mm";
    94 			libs[0].PlatformExt = true;
    95 
    96 			libs[1].Destination = "bin";
    97 			libs[1].LocalPath = "sourcepawn/jit/x86";
    98 			libs[1].Name = "sourcepawn.jit.x86";
    99 			libs[1].ProjectFile = "jit-x86";
   100 
   101 			libs[2].Destination = "scripting";
   102 			libs[2].LocalPath = "sourcepawn/compiler";
   103 			libs[2].Name = "spcomp";
   104 			libs[2].IsExecutable = true;
   105 
   106 			libs[3].Destination = "extensions";
   107 			libs[3].LocalPath = "extensions/geoip";
   108 			libs[3].Name = "geoip.ext";
   109 			libs[3].ProjectFile = "geoip";
   110 
   111 			libs[4].Destination = "extensions";
   112 			libs[4].LocalPath = "extensions/bintools";
   113 			libs[4].Name = "bintools.ext";
   114 			libs[4].ProjectFile = "bintools";
   115 
   116 			libs[5].Destination = "extensions";
   117 			libs[5].LocalPath = "extensions/mysql";
   118 			libs[5].Name = "dbi.mysql.ext";
   119 			libs[5].ProjectFile = "sm_mysql";
   120 
   121 			libs[6].Destination = "extensions";
   122 			libs[6].LocalPath = "extensions/sdktools";
   123 			libs[6].Name = "sdktools.ext";
   124 			libs[6].ProjectFile = "sdktools";
   125 
   126 			return libs;
   127 		}
   128 
   129 		/**
   130 		 * Called to build plugins
   131 		 */
   132 		public override Plugin [] GetPlugins()
   133 		{
   134 			Plugin [] plugins = new Plugin[3];
   135 
   136 			plugins[0] = new Plugin("admin-flatfile", "admin-flatfile");
   137 			plugins[1] = new Plugin("basecommands");
   138 			plugins[2] = new Plugin("antiflood");
   139 
   140 			return plugins;
   141 		}
   142 	}
   143 }
   144