tools/builder/Package.cs
author David Anderson <dvander@alliedmods.net>
Mon Jul 07 06:33:42 2008 +0000 (2008-07-07)
branchrefac-jit
changeset 2176 525f85d9af37
parent 2168 c24a6fa957db
child 2400 76b7b4575e21
permissions -rw-r--r--
fixed some build issues. deprecated ISourceMod::GetScriptingVM
     1 using System;
     2 
     3 namespace builder
     4 {
     5 	public enum ReleaseMode : int
     6 	{
     7 		ReleaseMode_Release,
     8 		ReleaseMode_Debug,
     9 	};
    10 
    11 	public enum BuildMode : int
    12 	{
    13 		BuildMode_Simple,
    14 		BuildMode_OldMetamod,
    15 		BuildMode_Episode1,
    16 		BuildMode_Episode2
    17 	};
    18 
    19 	public class Library
    20 	{
    21 		public Library()
    22 		{
    23 			has_platform_ext = false;
    24 			is_executable = false;
    25 			release_mode = ReleaseMode.ReleaseMode_Release;
    26 			build_mode = BuildMode.BuildMode_Simple;
    27 		}
    28 		public string binary_name;		/* Name of binary */
    29 		public string source_path;		/* Local path to library build scripts */
    30 		public ReleaseMode release_mode; /* Release mode */
    31 		public BuildMode build_mode;	/* Build mode */
    32 		public string package_path;		/* Final relative path */
    33 		public bool has_platform_ext;	/* Add extra platform extension? */
    34 		public string vcproj_name;		/* Project file, NULL for standard */
    35 		public bool is_executable;		/* If this is an EXE instead of a DLL */
    36 	};
    37 
    38 	public class Plugin
    39 	{
    40 		public Plugin(string file)
    41 		{
    42 			Source = file;
    43 			disabled = false;
    44 		}
    45 		public Plugin (string file, string folder)
    46 		{
    47 			Source = file;
    48 			Folder = folder;
    49 			disabled = false;
    50 		}
    51 		public Plugin (string file, bool is_disabled)
    52 		{
    53 			Source = file;
    54 			disabled = is_disabled;
    55 		}
    56 		public string Folder;		/* Source folder relative to scripting (null for default) */
    57 		public string Source;		/* Source file name */
    58 		public bool disabled;		/* Is the plugin disabled? */
    59 	};
    60 
    61 	public abstract class Package
    62 	{
    63 		/**
    64 		 * Must return the root compression point.
    65 		 */
    66 		public abstract void GetCompressBases(ref string path, ref string folder);
    67 
    68 		/**
    69 		 * Must return the base package output folder.
    70 		 */
    71 		public abstract string GetBaseFolder();
    72 
    73 		/** 
    74 		 * Must return the list of folders to create.
    75 		 */
    76 		public abstract string [] GetFolders();
    77 
    78 		/**
    79 		 * Called when file to file copies must be performed
    80 		 */
    81 		public abstract void OnCopyFiles(ABuilder builder);
    82 
    83 		/**
    84 		 * Called when dir to dir copies must be performed
    85 		 */
    86 		public abstract void OnCopyFolders(ABuilder builder);
    87 
    88 		/**
    89 		 * Called to build libraries
    90 		 */
    91 		public abstract Library [] GetLibraries();
    92 
    93 		/**
    94 		 * Called to get package name
    95 		 */
    96 		public abstract string GetPackageName();
    97 
    98 		/**
    99 		 * Called to get a plugin list
   100 		 */
   101 		public abstract Plugin [] GetPlugins();
   102 	}
   103 }