Port packaging to AMBuild 2 (bug 5997 part 6, r=ds).
authorDavid Anderson <dvander@alliedmods.net>
Mon Dec 30 17:50:59 2013 -0500 (2013-12-30)
changeset 4186c6a694ae8566
parent 4185 07d958c9b498
child 4187 e70b65bc70b9
Port packaging to AMBuild 2 (bug 5997 part 6, r=ds).
AMBuildScript
extensions/bintools/AMBuilder
extensions/clientprefs/AMBuilder
extensions/cstrike/AMBuilder
extensions/curl/AMBuilder
extensions/geoip/AMBuilder
extensions/mysql/AMBuilder
extensions/regex/AMBuilder
extensions/sdkhooks/AMBuilder
extensions/sdktools/AMBuilder
extensions/sqlite/AMBuilder
extensions/tf2/AMBuilder
extensions/topmenus/AMBuilder
extensions/updater/AMBuilder
plugins/AMBuilder
tools/buildbot/PackageScript
     1.1 --- a/AMBuildScript	Mon Dec 30 17:50:58 2013 -0500
     1.2 +++ b/AMBuildScript	Mon Dec 30 17:50:59 2013 -0500
     1.3 @@ -62,6 +62,7 @@
     1.4    def __init__(self):
     1.5      self.sdks = {}
     1.6      self.binaries = []
     1.7 +    self.extensions = []
     1.8      self.mms_root = None
     1.9      self.mysql_root = None
    1.10      self.spcomp = None
    1.11 @@ -412,6 +413,7 @@
    1.12      'sourcepawn/compiler/AMBuilder',
    1.13      'sourcepawn/jit/AMBuilder',
    1.14      'plugins/AMBuilder',
    1.15 +    'tools/buildbot/PackageScript',
    1.16    ],
    1.17    {
    1.18      'SM': SM
     2.1 --- a/extensions/bintools/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
     2.2 +++ b/extensions/bintools/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
     2.3 @@ -19,5 +19,5 @@
     2.4    'sdk/smsdk_ext.cpp'
     2.5  ]
     2.6  
     2.7 -SM.binaries += [builder.Add(binary)]
     2.8 +SM.extensions += [builder.Add(binary)]
     2.9  
     3.1 --- a/extensions/clientprefs/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
     3.2 +++ b/extensions/clientprefs/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
     3.3 @@ -15,5 +15,5 @@
     3.4    'sdk/smsdk_ext.cpp'
     3.5  ]
     3.6  
     3.7 -SM.binaries += [builder.Add(binary)]
     3.8 +SM.extensions += [builder.Add(binary)]
     3.9  
     4.1 --- a/extensions/cstrike/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
     4.2 +++ b/extensions/cstrike/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
     4.3 @@ -18,4 +18,4 @@
     4.4      'CDetour/detours.cpp',
     4.5      'asm/asm.c'
     4.6    ]
     4.7 -  SM.binaries += [builder.Add(binary)]
     4.8 +  SM.extensions += [builder.Add(binary)]
     5.1 --- a/extensions/curl/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
     5.2 +++ b/extensions/curl/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
     5.3 @@ -20,5 +20,5 @@
     5.4    'sdk/smsdk_ext.cpp',
     5.5  ]
     5.6  
     5.7 -SM.binaries += [builder.Add(binary)]
     5.8 +SM.extensions += [builder.Add(binary)]
     5.9  
     6.1 --- a/extensions/geoip/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
     6.2 +++ b/extensions/geoip/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
     6.3 @@ -11,5 +11,5 @@
     6.4    'sdk/smsdk_ext.cpp'
     6.5  ]
     6.6  
     6.7 -SM.binaries += [builder.Add(binary)]
     6.8 +SM.extensions += [builder.Add(binary)]
     6.9  
     7.1 --- a/extensions/mysql/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
     7.2 +++ b/extensions/mysql/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
     7.3 @@ -31,5 +31,5 @@
     7.4      'mysql/MyStatement.cpp',
     7.5      'extension.cpp'
     7.6    ]
     7.7 -  SM.binaries += [builder.Add(binary)]
     7.8 +  SM.extensions += [builder.Add(binary)]
     7.9  
     8.1 --- a/extensions/regex/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
     8.2 +++ b/extensions/regex/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
     8.3 @@ -20,5 +20,5 @@
     8.4    'sdk/smsdk_ext.cpp',
     8.5  ]
     8.6  
     8.7 -SM.binaries += [builder.Add(binary)]
     8.8 +SM.extensions += [builder.Add(binary)]
     8.9  
     9.1 --- a/extensions/sdkhooks/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
     9.2 +++ b/extensions/sdkhooks/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
     9.3 @@ -18,4 +18,4 @@
     9.4      'util.cpp',
     9.5      'sdk/smsdk_ext.cpp',
     9.6    ]
     9.7 -  SM.binaries += [builder.Add(binary)]
     9.8 +  SM.extensions += [builder.Add(binary)]
    10.1 --- a/extensions/sdktools/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
    10.2 +++ b/extensions/sdktools/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
    10.3 @@ -42,4 +42,4 @@
    10.4      'sdk/smsdk_ext.cpp',
    10.5      'asm/asm.c'
    10.6    ]
    10.7 -  SM.binaries += [builder.Add(binary)]
    10.8 +  SM.extensions += [builder.Add(binary)]
    11.1 --- a/extensions/sqlite/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
    11.2 +++ b/extensions/sqlite/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
    11.3 @@ -24,5 +24,5 @@
    11.4    'sqlite-source/sqlite3.c'
    11.5  ]
    11.6  
    11.7 -SM.binaries += [builder.Add(binary)]
    11.8 +SM.extensions += [builder.Add(binary)]
    11.9  
    12.1 --- a/extensions/tf2/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
    12.2 +++ b/extensions/tf2/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
    12.3 @@ -19,4 +19,4 @@
    12.4  		'sdk/smsdk_ext.cpp',
    12.5  		'asm/asm.c'
    12.6    ]
    12.7 -  SM.binaries += [builder.Add(binary)]
    12.8 +  SM.extensions += [builder.Add(binary)]
    13.1 --- a/extensions/topmenus/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
    13.2 +++ b/extensions/topmenus/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
    13.3 @@ -15,5 +15,4 @@
    13.4    'sdk/sm_memtable.cpp'
    13.5  ]
    13.6  
    13.7 -SM.binaries += [builder.Add(binary)]
    13.8 -
    13.9 +SM.extensions += [builder.Add(binary)]
    14.1 --- a/extensions/updater/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
    14.2 +++ b/extensions/updater/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
    14.3 @@ -14,6 +14,5 @@
    14.4    'sdk/smsdk_ext.cpp'
    14.5  ]
    14.6  
    14.7 -SM.binaries += [builder.Add(binary)]
    14.8 +SM.extensions += [builder.Add(binary)]
    14.9  
   14.10 -
    15.1 --- a/plugins/AMBuilder	Mon Dec 30 17:50:58 2013 -0500
    15.2 +++ b/plugins/AMBuilder	Mon Dec 30 17:50:59 2013 -0500
    15.3 @@ -44,7 +44,7 @@
    15.4      smx_file
    15.5    ]
    15.6    argv = spcomp_argv + [script_path]
    15.7 -  cmd_entry, smx_entry = builder.AddCommand(
    15.8 +  cmd_entry, (smx_entry,) = builder.AddCommand(
    15.9      inputs = inputs,
   15.10      argv = argv,
   15.11      outputs = outputs,
    16.1 --- a/tools/buildbot/PackageScript	Mon Dec 30 17:50:58 2013 -0500
    16.2 +++ b/tools/buildbot/PackageScript	Mon Dec 30 17:50:59 2013 -0500
    16.3 @@ -1,277 +1,442 @@
    16.4 -# vim: set ts=2 sw=2 tw=99 noet ft=python: 
    16.5 +# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python: 
    16.6  import os
    16.7 -import shutil
    16.8 -import ambuild.osutil as osutil
    16.9 -from ambuild.command import Command
   16.10 -
   16.11 -job = AMBuild.AddJob('package')
   16.12 -
   16.13 -class DestroyPath(Command):
   16.14 -	def __init__(self, folder):
   16.15 -		Command.__init__(self)
   16.16 -		self.folder = folder
   16.17 -
   16.18 -	def destroy(self, path):
   16.19 -		entries = os.listdir(path)
   16.20 -		for entry in entries:
   16.21 -			newpath = os.path.join(path, entry)
   16.22 -			if os.path.isdir(newpath):
   16.23 -				self.destroy(newpath)
   16.24 -				os.rmdir(newpath)
   16.25 -			elif os.path.isfile(newpath):
   16.26 -				os.remove(newpath)
   16.27 -
   16.28 -	def run(self, runner, job):
   16.29 -		runner.PrintOut('rm -rf {0}/*'.format(self.folder))
   16.30 -		self.destroy(self.folder)
   16.31  
   16.32 -class CreateFolders(Command):
   16.33 -	def __init__(self, folders):
   16.34 -		Command.__init__(self)
   16.35 -		self.folders = folders
   16.36 -	
   16.37 -	def run(self, runner, job):
   16.38 -		for folder in self.folders:
   16.39 -			path = os.path.join(*folder)
   16.40 -			runner.PrintOut('mkdir {0}'.format(path))
   16.41 -			os.makedirs(path)
   16.42 -
   16.43 -#Shallow folder copy
   16.44 -class CopyFolder(Command):
   16.45 -	def __init__(self, fromList, toList, excludes = []):
   16.46 -		Command.__init__(self)
   16.47 -		self.fromPath = os.path.join(AMBuild.sourceFolder, *fromList)
   16.48 -		self.toPath = os.path.join(*toList) 
   16.49 -		self.excludes = excludes
   16.50 -	
   16.51 -	def run(self, runner, job):
   16.52 -		entries = os.listdir(self.fromPath)
   16.53 -		for entry in entries:
   16.54 -			if entry in self.excludes:
   16.55 -				continue
   16.56 -			path = os.path.join(self.fromPath, entry)
   16.57 -			if not os.path.isfile(path):
   16.58 -				continue
   16.59 -			runner.PrintOut('copy {0} to {1}'.format(path, self.toPath))
   16.60 -			shutil.copy(path, self.toPath)
   16.61 -
   16.62 -#Single file copy
   16.63 -class CopyFile(Command):
   16.64 -	def __init__(self, fromFile, toPath):
   16.65 -		Command.__init__(self)
   16.66 -		self.fromFile = fromFile
   16.67 -		self.toPath = toPath
   16.68 -
   16.69 -	def run(self, runner, job):
   16.70 -		runner.PrintOut('copy {0} to {1}'.format(self.fromFile, self.toPath))
   16.71 -		shutil.copy(self.fromFile, self.toPath)
   16.72 -
   16.73 +builder.SetBuildFolder('package')
   16.74  
   16.75 -folders = [['addons', 'sourcemod', 'bin'],
   16.76 -           ['addons', 'sourcemod', 'plugins', 'disabled'],
   16.77 -           ['addons', 'sourcemod', 'gamedata'],
   16.78 -           ['addons', 'sourcemod', 'gamedata', 'core.games'],
   16.79 -		   ['addons', 'sourcemod', 'gamedata', 'sdkhooks.games'],
   16.80 -           ['addons', 'sourcemod', 'gamedata', 'sdktools.games'],
   16.81 -		   ['addons', 'sourcemod', 'gamedata', 'sm-cstrike.games'],
   16.82 -           ['addons', 'sourcemod', 'configs', 'geoip'],
   16.83 -           ['addons', 'sourcemod', 'translations'],
   16.84 -           ['addons', 'sourcemod', 'logs'],
   16.85 -           ['addons', 'sourcemod', 'extensions'],
   16.86 -           ['addons', 'sourcemod', 'data'],
   16.87 -           ['addons', 'sourcemod', 'scripting', 'include'],
   16.88 -           ['addons', 'sourcemod', 'scripting', 'admin-flatfile'],
   16.89 -           ['addons', 'sourcemod', 'scripting', 'adminmenu'],
   16.90 -           ['addons', 'sourcemod', 'scripting', 'testsuite'],
   16.91 -           ['cfg', 'sourcemod'],
   16.92 -           ['addons', 'sourcemod', 'configs', 'sql-init-scripts'],
   16.93 -           ['addons', 'sourcemod', 'configs', 'sql-init-scripts', 'mysql'],
   16.94 -           ['addons', 'sourcemod', 'configs', 'sql-init-scripts', 'sqlite'],
   16.95 -           ['addons', 'sourcemod', 'scripting', 'basecommands'],
   16.96 -           ['addons', 'sourcemod', 'scripting', 'basecomm'],
   16.97 -           ['addons', 'sourcemod', 'scripting', 'funvotes'],
   16.98 -           ['addons', 'sourcemod', 'scripting', 'basevotes'],
   16.99 -           ['addons', 'sourcemod', 'scripting', 'basebans'],
  16.100 -           ['addons', 'sourcemod', 'scripting', 'funcommands'],
  16.101 -           ['addons', 'sourcemod', 'scripting', 'playercommands'],
  16.102 -           ['addons', 'metamod'],
  16.103 -          ]
  16.104 -
  16.105 -#Setup
  16.106 -job.AddCommand(DestroyPath(os.path.join(AMBuild.outputFolder, 'package')))
  16.107 -job.AddCommand(CreateFolders(folders))
  16.108 -
  16.109 -#Copy Folders
  16.110 -job.AddCommand(CopyFolder(['configs'], ['addons', 'sourcemod', 'configs']))
  16.111 -job.AddCommand(CopyFolder(['configs', 'geoip'], ['addons', 'sourcemod', 'configs', 'geoip']))
  16.112 -job.AddCommand(CopyFolder(['configs', 'cfg'], ['cfg', 'sourcemod']))
  16.113 -job.AddCommand(CopyFolder(['configs', 'metamod'], ['addons', 'metamod']))
  16.114 -job.AddCommand(CopyFolder(['configs', 'sql-init-scripts'],
  16.115 -	['addons', 'sourcemod', 'configs', 'sql-init-scripts']))
  16.116 -job.AddCommand(CopyFolder(['configs', 'sql-init-scripts', 'mysql'],
  16.117 -	['addons', 'sourcemod', 'configs', 'sql-init-scripts', 'mysql']))
  16.118 -job.AddCommand(CopyFolder(['configs', 'sql-init-scripts', 'sqlite'],
  16.119 -	['addons', 'sourcemod', 'configs', 'sql-init-scripts', 'sqlite']))
  16.120 -job.AddCommand(CopyFolder(['gamedata'], ['addons', 'sourcemod', 'gamedata']))
  16.121 -job.AddCommand(CopyFolder(['gamedata', 'sdkhooks.games'],
  16.122 -	['addons', 'sourcemod', 'gamedata', 'sdkhooks.games']))
  16.123 -job.AddCommand(CopyFolder(['gamedata', 'sdktools.games'],
  16.124 -	['addons', 'sourcemod', 'gamedata', 'sdktools.games']))
  16.125 -job.AddCommand(CopyFolder(['gamedata', 'core.games'],
  16.126 -	['addons', 'sourcemod', 'gamedata', 'core.games']))
  16.127 -job.AddCommand(CopyFolder(['gamedata', 'sm-cstrike.games'],
  16.128 -	['addons', 'sourcemod', 'gamedata', 'sm-cstrike.games']))
  16.129 -job.AddCommand(CopyFolder(['plugins'], ['addons', 'sourcemod', 'scripting'], ['AMBuilder']))
  16.130 -job.AddCommand(CopyFolder(['plugins', 'include'],
  16.131 -	['addons', 'sourcemod', 'scripting', 'include']))
  16.132 -job.AddCommand(CopyFolder(['translations'], ['addons', 'sourcemod', 'translations']))
  16.133 -job.AddCommand(CopyFolder(['public', 'licenses'], ['addons', 'sourcemod']))
  16.134 -job.AddCommand(CopyFolder(['plugins', 'admin-flatfile'],
  16.135 -	['addons', 'sourcemod', 'scripting', 'admin-flatfile']))
  16.136 -job.AddCommand(CopyFolder(['plugins', 'adminmenu'],
  16.137 -	['addons', 'sourcemod', 'scripting', 'adminmenu']))
  16.138 -job.AddCommand(CopyFolder(['plugins', 'testsuite'],
  16.139 -	['addons', 'sourcemod', 'scripting', 'testsuite']))
  16.140 -job.AddCommand(CopyFolder(['plugins', 'basecommands'],
  16.141 -	['addons', 'sourcemod', 'scripting', 'basecommands']))
  16.142 -job.AddCommand(CopyFolder(['plugins', 'basecomm'],
  16.143 -	['addons', 'sourcemod', 'scripting', 'basecomm']))
  16.144 -job.AddCommand(CopyFolder(['plugins', 'funvotes'],
  16.145 -	['addons', 'sourcemod', 'scripting', 'funvotes']))
  16.146 -job.AddCommand(CopyFolder(['plugins', 'basevotes'],
  16.147 -	['addons', 'sourcemod', 'scripting', 'basevotes']))
  16.148 -job.AddCommand(CopyFolder(['plugins', 'basebans'],
  16.149 -	['addons', 'sourcemod', 'scripting', 'basebans']))
  16.150 -job.AddCommand(CopyFolder(['plugins', 'funcommands'],
  16.151 -	['addons', 'sourcemod', 'scripting', 'funcommands']))
  16.152 -job.AddCommand(CopyFolder(['plugins', 'playercommands'],
  16.153 -	['addons', 'sourcemod', 'scripting', 'playercommands']))
  16.154 -
  16.155 -defPlugins = [
  16.156 -	'admin-flatfile',
  16.157 -	'adminhelp',
  16.158 -	'antiflood',
  16.159 -	'basecommands',
  16.160 -	'reservedslots',
  16.161 -	'basetriggers',
  16.162 -	'nextmap',
  16.163 -	'basechat',
  16.164 -	'funcommands',
  16.165 -	'basevotes',
  16.166 -	'funvotes',
  16.167 -	'basebans',
  16.168 -	'basecomm',
  16.169 -	'adminmenu',
  16.170 -	'playercommands',
  16.171 -	'clientprefs',
  16.172 -	'sounds'
  16.173 +folder_list = [
  16.174 +  'addons/sourcemod',
  16.175 +  'addons/sourcemod/bin',
  16.176 +  'addons/sourcemod/plugins',
  16.177 +  'addons/sourcemod/plugins/disabled',
  16.178 +  'addons/sourcemod/gamedata',
  16.179 +  'addons/sourcemod/gamedata/core.games',
  16.180 +  'addons/sourcemod/gamedata/sdkhooks.games',
  16.181 +  'addons/sourcemod/gamedata/sdktools.games',
  16.182 +  'addons/sourcemod/gamedata/sm-cstrike.games',
  16.183 +  'addons/sourcemod/configs',
  16.184 +  'addons/sourcemod/configs/geoip',
  16.185 +  'addons/sourcemod/translations',
  16.186 +  'addons/sourcemod/logs',
  16.187 +  'addons/sourcemod/extensions',
  16.188 +  'addons/sourcemod/data',
  16.189 +  'addons/sourcemod/configs/sql-init-scripts',
  16.190 +  'addons/sourcemod/configs/sql-init-scripts/mysql',
  16.191 +  'addons/sourcemod/configs/sql-init-scripts/sqlite',
  16.192 +  'addons/sourcemod/scripting',
  16.193 +  'addons/sourcemod/scripting/include',
  16.194 +  'addons/sourcemod/scripting/admin-flatfile',
  16.195 +  'addons/sourcemod/scripting/adminmenu',
  16.196 +  'addons/sourcemod/scripting/testsuite',
  16.197 +  'addons/sourcemod/scripting/basecommands',
  16.198 +  'addons/sourcemod/scripting/basecomm',
  16.199 +  'addons/sourcemod/scripting/funvotes',
  16.200 +  'addons/sourcemod/scripting/basevotes',
  16.201 +  'addons/sourcemod/scripting/basebans',
  16.202 +  'addons/sourcemod/scripting/funcommands',
  16.203 +  'addons/sourcemod/scripting/playercommands',
  16.204 +  'addons/metamod',
  16.205 +  'cfg/sourcemod',
  16.206  ]
  16.207  
  16.208 -disPlugins = [
  16.209 -	'admin-sql-prefetch',
  16.210 -	'admin-sql-threaded',
  16.211 -	'sql-admin-manager',
  16.212 -	'mapchooser',
  16.213 -	'randomcycle',
  16.214 -	'rockthevote',
  16.215 -	'nominations'
  16.216 -]
  16.217 +# Create the distribution folder hierarchy.
  16.218 +folder_map = {}
  16.219 +for folder in folder_list:
  16.220 +  norm_folder = os.path.normpath(folder)
  16.221 +  folder_map[folder] = builder.AddFolder(norm_folder)
  16.222  
  16.223 -commands = []
  16.224 -for plugin in defPlugins:
  16.225 -	commands.append(CopyFile(os.path.join('..', 'plugins', plugin + '.smx'),
  16.226 -	                         os.path.join('addons', 'sourcemod', 'plugins')))
  16.227 -
  16.228 -for plugin in disPlugins:
  16.229 -	commands.append(CopyFile(os.path.join('..', 'plugins', plugin + '.smx'),
  16.230 -	                         os.path.join('addons', 'sourcemod', 'plugins', 'disabled')))
  16.231 -job.AddCommandGroup(commands)
  16.232 -
  16.233 -job.AddCommand(CopyFile(os.path.join('..', 'includes', 'version_auto.inc'),
  16.234 -	os.path.join('addons', 'sourcemod', 'scripting', 'include')))
  16.235 +# Copy binaries.
  16.236 +for cxx_task in SM.binaries:
  16.237 +  builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/bin'])
  16.238 +for cxx_task in SM.extensions:
  16.239 +  builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/extensions'])
  16.240 +builder.AddCopy(SM.spcomp.binary, folder_map['addons/sourcemod/scripting'])
  16.241  
  16.242 -bincopies = []
  16.243 +# Copy plugins.
  16.244 +disabled_plugins = set([
  16.245 +  'admin-sql-prefetch.smx',
  16.246 +  'admin-sql-threaded.smx',
  16.247 +  'sql-admin-manager.smx',
  16.248 +  'mapchooser.smx',
  16.249 +  'randomcycle.smx',
  16.250 +  'rockthevote.smx',
  16.251 +  'nominations.smx',
  16.252 +])
  16.253  
  16.254 -def AddNormalLibrary(name, dest):
  16.255 -	dest = os.path.join('addons', 'sourcemod', dest)
  16.256 -	bincopies.append(CopyFile(os.path.join('..', name, name + osutil.SharedLibSuffix()), dest))
  16.257 -	
  16.258 -	# Each platform's version of dump_syms needs the path in a different format.
  16.259 -	if AMBuild.target['platform'] == 'linux':
  16.260 -		debug_info.append(name + '/' + name + '.so')
  16.261 -	elif AMBuild.target['platform'] == 'darwin':
  16.262 -		debug_info.append(name + '/' + name + '.dylib.dSYM')
  16.263 -	elif AMBuild.target['platform'] == 'windows':
  16.264 -		debug_info.append(name + '\\' + name + '.pdb')
  16.265 +for smx_file in SM.smx_files:
  16.266 +  smx_entry = SM.smx_files[smx_file]
  16.267 +  if smx_file in disabled_plugins:
  16.268 +    builder.AddCopy(smx_entry, folder_map['addons/sourcemod/plugins/disabled'])
  16.269 +  else:
  16.270 +    builder.AddCopy(smx_entry, folder_map['addons/sourcemod/plugins'])
  16.271  
  16.272 -def AddHL2Library(name, dest):
  16.273 -	for i in SM.sdkInfo:
  16.274 -		sdk = SM.sdkInfo[i]
  16.275 -		if AMBuild.target['platform'] not in sdk['platform']:
  16.276 -			continue
  16.277 -		AddNormalLibrary(name + '.' + sdk['ext'], dest)
  16.278 -
  16.279 -debug_info = []
  16.280 +# Do all straight-up file copies from the source tree.
  16.281 +def CopyFiles(src, dest, files):
  16.282 +  if not dest:
  16.283 +    dest = src
  16.284 +  dest_entry = folder_map[dest]
  16.285 +  for source_file in files:
  16.286 +    source_path = os.path.join(builder.sourcePath, src, source_file)
  16.287 +    builder.AddCopy(source_path, dest_entry)
  16.288  
  16.289 -if AMBuild.target['platform'] == 'linux':
  16.290 -	bincopies.append(CopyFile(os.path.join('..', 'loader', 'sourcemod_mm_i486.so'),
  16.291 -	                 os.path.join('addons', 'sourcemod', 'bin')))
  16.292 -	debug_info.append('loader/sourcemod_mm_i486.so')
  16.293 -elif AMBuild.target['platform'] == 'darwin':
  16.294 -	bincopies.append(CopyFile(os.path.join('..', 'loader', 'sourcemod_mm.dylib'),
  16.295 -	                 os.path.join('addons', 'sourcemod', 'bin')))
  16.296 -	debug_info.append('loader/sourcemod_mm.dylib.dSYM')
  16.297 -elif AMBuild.target['platform'] == 'windows':
  16.298 -	bincopies.append(CopyFile(os.path.join('..', 'loader', 'sourcemod_mm.dll'),
  16.299 -	                 os.path.join('addons', 'sourcemod', 'bin')))
  16.300 -	debug_info.append('loader\\sourcemod_mm.pdb')
  16.301 -
  16.302 -AddHL2Library('sourcemod', 'bin')
  16.303 -AddNormalLibrary('sourcemod.logic', 'bin')
  16.304 -AddNormalLibrary('sourcepawn.jit.x86', 'bin')
  16.305 -AddNormalLibrary('geoip.ext', 'extensions')
  16.306 -if SM.hasMySql:
  16.307 -	AddNormalLibrary('dbi.mysql.ext', 'extensions')
  16.308 -AddNormalLibrary('dbi.sqlite.ext', 'extensions')
  16.309 -
  16.310 -if 'css' in SM.sdkInfo:
  16.311 -	AddNormalLibrary('game.cstrike.ext.2.css', 'extensions')
  16.312 -
  16.313 -if 'csgo' in SM.sdkInfo:
  16.314 -	AddNormalLibrary('game.cstrike.ext.2.csgo', 'extensions')
  16.315 -
  16.316 -if 'tf2' in SM.sdkInfo:
  16.317 -	AddNormalLibrary('game.tf2.ext.2.tf2', 'extensions')
  16.318 -
  16.319 -AddNormalLibrary('topmenus.ext', 'extensions')
  16.320 -AddNormalLibrary('regex.ext', 'extensions')
  16.321 -AddNormalLibrary('webternet.ext', 'extensions')
  16.322 -AddNormalLibrary('clientprefs.ext', 'extensions')
  16.323 -AddNormalLibrary('updater.ext', 'extensions')
  16.324 -AddNormalLibrary('bintools.ext', 'extensions')
  16.325 -AddHL2Library('sdkhooks.ext', 'extensions')
  16.326 -AddHL2Library('sdktools.ext', 'extensions')
  16.327 -
  16.328 -bincopies.append(CopyFile(os.path.join('..', 'spcomp', 'spcomp' + osutil.ExecutableSuffix()),
  16.329 -                          os.path.join('addons', 'sourcemod', 'scripting')))
  16.330 -
  16.331 -# Each platform's version of dump_syms needs the path in a different format.
  16.332 -if AMBuild.target['platform'] == 'linux':
  16.333 -	debug_info.append('spcomp' + '/' + 'spcomp')
  16.334 -elif AMBuild.target['platform'] == 'darwin':
  16.335 -	debug_info.append('spcomp' + '/' + 'spcomp' + '.dSYM')
  16.336 -elif AMBuild.target['platform'] == 'windows':
  16.337 -	debug_info.append('spcomp' + '\\' + 'spcomp' + '.pdb')
  16.338 -
  16.339 -job.AddCommandGroup(bincopies)
  16.340 -
  16.341 -if AMBuild.target['platform'] == 'windows':
  16.342 -	job.AddCommand(CopyFile(
  16.343 -		os.path.join(AMBuild.sourceFolder, 'sourcepawn', 'batchtool', 'compile.exe'),
  16.344 -		os.path.join('addons', 'sourcemod', 'scripting')))
  16.345 -	
  16.346 -pdblog = open(os.path.join(AMBuild.outputFolder, 'pdblog.txt'), 'wt')
  16.347 -for pdb in debug_info:
  16.348 -	pdblog.write(pdb + '\n')
  16.349 -pdblog.close()
  16.350 -
  16.351 +CopyFiles('configs', 'addons/sourcemod/configs',
  16.352 +  [ 'admin_groups.cfg',
  16.353 +    'admin_levels.cfg',
  16.354 +    'admin_overrides.cfg',
  16.355 +    'adminmenu_cfgs.txt',
  16.356 +    'adminmenu_custom.txt',
  16.357 +    'adminmenu_grouping.txt',
  16.358 +    'adminmenu_sorting.txt',
  16.359 +    'admins.cfg',
  16.360 +    'admins_simple.ini',
  16.361 +    'banreasons.txt',
  16.362 +    'core.cfg',
  16.363 +    'databases.cfg',
  16.364 +    'languages.cfg',
  16.365 +    'maplists.cfg',
  16.366 +  ]
  16.367 +)
  16.368 +CopyFiles('configs/geoip', 'addons/sourcemod/configs/geoip', ['GeoIP.dat'])
  16.369 +CopyFiles('configs/cfg', 'cfg/sourcemod',
  16.370 +  [ 'sm_warmode_off.cfg',
  16.371 +    'sm_warmode_on.cfg',
  16.372 +    'sourcemod.cfg',
  16.373 +  ]
  16.374 +)
  16.375 +CopyFiles('configs/metamod', 'addons/metamod', ['sourcemod.vdf'])
  16.376 +CopyFiles('configs/sql-init-scripts/mysql', 'addons/sourcemod/configs/sql-init-scripts/mysql',
  16.377 +  [ 'clientprefs-mysql.sql',
  16.378 +    'create_admins.sql',
  16.379 +    'update_admins_r1409.sql',
  16.380 +  ]
  16.381 +)
  16.382 +CopyFiles('configs/sql-init-scripts/sqlite', 'addons/sourcemod/configs/sql-init-scripts/sqlite',
  16.383 +  [ 'admins-sqlite.sq3',
  16.384 +    'clientprefs-sqlite.sq3',
  16.385 +    'clientprefs-sqlite.sql',
  16.386 +    'create_admins.sql',
  16.387 +    'update_admins-r1409.sql',
  16.388 +  ]
  16.389 +)
  16.390 +CopyFiles('gamedata', 'addons/sourcemod/gamedata', ['sm-tf2.games.txt'])
  16.391 +CopyFiles('gamedata/sdkhooks.games', 'addons/sourcemod/gamedata/sdkhooks.games',
  16.392 +  [ 'common.games.txt',
  16.393 +    'engine.blade.txt',
  16.394 +    'engine.csgo.txt',
  16.395 +    'engine.darkm.txt',
  16.396 +    'engine.dota.txt',
  16.397 +    'engine.ep2v.txt',
  16.398 +    'engine.insurgency.txt',
  16.399 +    'engine.l4d.txt',
  16.400 +    'game.ag2.txt',
  16.401 +    'game.alienswarm.txt',
  16.402 +    'game.aoc.txt',
  16.403 +    'game.cspromod.txt',
  16.404 +    'game.cstrike.txt',
  16.405 +    'game.dinodday.txt',
  16.406 +    'game.empires.txt',
  16.407 +    'game.ff.txt',
  16.408 +    'game.fof.txt',
  16.409 +    'game.garrysmod.txt',
  16.410 +    'game.gesource.txt',
  16.411 +    'game.hidden.txt',
  16.412 +    'game.hl2ctf.txt',
  16.413 +    'game.insurgency.txt',
  16.414 +    'game.l4d2.txt',
  16.415 +    'game.neotokyo.txt',
  16.416 +    'game.nmrih.txt',
  16.417 +    'game.nucleardawn.txt',
  16.418 +    'game.pvkii.txt',
  16.419 +    'game.sgtls.txt',
  16.420 +    'game.sourceforts.txt',
  16.421 +    'game.synergy.txt',
  16.422 +    'game.zm.txt',
  16.423 +    'game.zpanic.txt',
  16.424 +    'master.games.txt',
  16.425 +  ]
  16.426 +)
  16.427 +CopyFiles('gamedata/sdktools.games', 'addons/sourcemod/gamedata/sdktools.games',
  16.428 +  [ 'common.games.txt',
  16.429 +    'engine.bgt.txt',
  16.430 +    'engine.blade.txt',
  16.431 +    'engine.csgo.txt',
  16.432 +    'engine.css.txt',
  16.433 +    'engine.darkm.txt',
  16.434 +    'engine.dota.txt',
  16.435 +    'engine.ep1.txt',
  16.436 +    'engine.ep2.txt',
  16.437 +    'engine.ep2valve.txt',
  16.438 +    'engine.eye.txt',
  16.439 +    'engine.insurgency.txt',
  16.440 +    'engine.l4d.txt',
  16.441 +    'engine.l4d2.txt',
  16.442 +    'engine.sdk2013.txt',
  16.443 +    'engine.swarm.txt',
  16.444 +    'game.ag2.txt',
  16.445 +    'game.alienswarm.txt',
  16.446 +    'game.aoc.txt',
  16.447 +    'game.bg2.txt',
  16.448 +    'game.cspromod.txt',
  16.449 +    'game.cstrike.txt',
  16.450 +    'game.dinodday.txt',
  16.451 +    'game.dod.txt',
  16.452 +    'game.dystopia.txt',
  16.453 +    'game.empires.txt',
  16.454 +    'game.esmod.txt',
  16.455 +    'game.fas.txt',
  16.456 +    'game.ff.txt',
  16.457 +    'game.fof.txt',
  16.458 +    'game.garrysmod.txt',
  16.459 +    'game.gesource.txt',
  16.460 +    'game.hidden.txt',
  16.461 +    'game.hl2ctf.txt',
  16.462 +    'game.hl2mp.txt',
  16.463 +    'game.insurgency.txt',
  16.464 +    'game.ios.txt',
  16.465 +    'game.left4dead2.txt',
  16.466 +    'game.neotokyo.txt',
  16.467 +    'game.nmrih.txt',
  16.468 +    'game.nucleardawn.txt',
  16.469 +    'game.obsidian.txt',
  16.470 +    'game.pvkii.txt',
  16.471 +    'game.rnlbeta.txt',
  16.472 +    'game.ship.txt',
  16.473 +    'game.sourceforts.txt',
  16.474 +    'game.synergy.txt',
  16.475 +    'game.tf.txt',
  16.476 +    'game.zm.txt',
  16.477 +    'game.zpanic.txt',
  16.478 +    'master.games.txt',
  16.479 +  ]
  16.480 +)
  16.481 +CopyFiles('gamedata/core.games', 'addons/sourcemod/gamedata/core.games',
  16.482 +  [ 'blacklist.plugins.txt',
  16.483 +    'common.games.txt',
  16.484 +    'engine.bgt.txt',
  16.485 +    'engine.blade.txt',
  16.486 +    'engine.csgo.txt',
  16.487 +    'engine.css.txt',
  16.488 +    'engine.darkm.txt',
  16.489 +    'engine.dota.txt',
  16.490 +    'engine.ep1.txt',
  16.491 +    'engine.ep2.txt',
  16.492 +    'engine.ep2valve.txt',
  16.493 +    'engine.eye.txt',
  16.494 +    'engine.insurgency.txt',
  16.495 +    'engine.l4d.txt',
  16.496 +    'engine.l4d2.txt',
  16.497 +    'engine.sdk2013.txt',
  16.498 +    'engine.swarm.txt',
  16.499 +    'master.games.txt',
  16.500 +  ]
  16.501 +)
  16.502 +CopyFiles('gamedata/sm-cstrike.games', 'addons/sourcemod/gamedata/sm-cstrike.games',
  16.503 +  [ 'game.csgo.txt',
  16.504 +    'game.css.txt',
  16.505 +    'master.games.txt',
  16.506 +  ]
  16.507 +)
  16.508 +CopyFiles('plugins', 'addons/sourcemod/scripting',
  16.509 +  [ 'admin-sql-prefetch.sp',
  16.510 +    'admin-sql-threaded.sp',
  16.511 +    'adminhelp.sp',
  16.512 +    'adminmenu.sp',
  16.513 +    'antiflood.sp',
  16.514 +    'basebans.sp',
  16.515 +    'basechat.sp',
  16.516 +    'basecomm.sp',
  16.517 +    'basecommands.sp',
  16.518 +    'basetriggers.sp',
  16.519 +    'basevotes.sp',
  16.520 +    'clientprefs.sp',
  16.521 +    'compile.sh',
  16.522 +    'funcommands.sp',
  16.523 +    'funvotes.sp',
  16.524 +    'mapchooser.sp',
  16.525 +    'nextmap.sp',
  16.526 +    'nominations.sp',
  16.527 +    'playercommands.sp',
  16.528 +    'randomcycle.sp',
  16.529 +    'reservedslots.sp',
  16.530 +    'rockthevote.sp',
  16.531 +    'sounds.sp',
  16.532 +    'sql-admin-manager.sp',
  16.533 +  ]
  16.534 +)
  16.535 +CopyFiles('plugins/include', 'addons/sourcemod/scripting/include',
  16.536 +  [ 'admin.inc',
  16.537 +    'adminmenu.inc',
  16.538 +    'adt.inc',
  16.539 +    'adt_array.inc',
  16.540 +    'adt_stack.inc',
  16.541 +    'adt_trie.inc',
  16.542 +    'banning.inc',
  16.543 +    'basecomm.inc',
  16.544 +    'bitbuffer.inc',
  16.545 +    'clientprefs.inc',
  16.546 +    'clients.inc',
  16.547 +    'commandfilters.inc',
  16.548 +    'console.inc',
  16.549 +    'core.inc',
  16.550 +    'cstrike.inc',
  16.551 +    'datapack.inc',
  16.552 +    'dbi.inc',
  16.553 +    'entity.inc',
  16.554 +    'entity_prop_stocks.inc',
  16.555 +    'events.inc',
  16.556 +    'files.inc',
  16.557 +    'float.inc',
  16.558 +    'functions.inc',
  16.559 +    'geoip.inc',
  16.560 +    'halflife.inc',
  16.561 +    'handles.inc',
  16.562 +    'helpers.inc',
  16.563 +    'keyvalues.inc',
  16.564 +    'lang.inc',
  16.565 +    'logging.inc',
  16.566 +    'mapchooser.inc',
  16.567 +    'menus.inc',
  16.568 +    'nextmap.inc',
  16.569 +    'profiler.inc',
  16.570 +    'protobuf.inc',
  16.571 +    'regex.inc',
  16.572 +    'sdkhooks.inc',
  16.573 +    'sdktools.inc',
  16.574 +    'sdktools_client.inc',
  16.575 +    'sdktools_engine.inc',
  16.576 +    'sdktools_entinput.inc',
  16.577 +    'sdktools_entoutput.inc',
  16.578 +    'sdktools_functions.inc',
  16.579 +    'sdktools_gamerules.inc',
  16.580 +    'sdktools_hooks.inc',
  16.581 +    'sdktools_sound.inc',
  16.582 +    'sdktools_stocks.inc',
  16.583 +    'sdktools_stringtables.inc',
  16.584 +    'sdktools_tempents.inc',
  16.585 +    'sdktools_tempents_stocks.inc',
  16.586 +    'sdktools_trace.inc',
  16.587 +    'sdktools_voice.inc',
  16.588 +    'sorting.inc',
  16.589 +    'sourcemod.inc',
  16.590 +    'string.inc',
  16.591 +    'textparse.inc',
  16.592 +    'tf2.inc',
  16.593 +    'tf2_stocks.inc',
  16.594 +    'timers.inc',
  16.595 +    'topmenus.inc',
  16.596 +    'usermessages.inc',
  16.597 +    'vector.inc',
  16.598 +    'version.inc',
  16.599 +  ]
  16.600 +)
  16.601 +CopyFiles('translations', 'addons/sourcemod/translations',
  16.602 +  [ 'adminhelp.phrases.txt',
  16.603 +    'adminmenu.phrases.txt',
  16.604 +    'antiflood.phrases.txt',
  16.605 +    'basebans.phrases.txt',
  16.606 +    'basecomm.phrases.txt',
  16.607 +    'basetriggers.phrases.txt',
  16.608 +    'basevotes.phrases.txt',
  16.609 +    'clientprefs.phrases.txt',
  16.610 +    'common.phrases.txt',
  16.611 +    'core.phrases.txt',
  16.612 +    'funcommands.phrases.txt',
  16.613 +    'funvotes.phrases.txt',
  16.614 +    'mapchooser.phrases.txt',
  16.615 +    'nextmap.phrases.txt',
  16.616 +    'nominations.phrases.txt',
  16.617 +    'playercommands.phrases.txt',
  16.618 +    'plugin.basecommands.txt',
  16.619 +    'reservedslots.phrases.txt',
  16.620 +    'rockthevote.phrases.txt',
  16.621 +    'sounds.phrases.txt',
  16.622 +    'sqladmins.phrases.txt',
  16.623 +  ]
  16.624 +)
  16.625 +CopyFiles('public/licenses', 'addons/sourcemod',
  16.626 +  [ 'GPLv2.txt',
  16.627 +    'GPLv3.txt',
  16.628 +    'LICENSE.txt'
  16.629 +  ]
  16.630 +)
  16.631 +CopyFiles('plugins/admin-flatfile', 'addons/sourcemod/scripting/admin-flatfile',
  16.632 +  [ 'admin-flatfile.sp',
  16.633 +    'admin-groups.sp',
  16.634 +    'admin-overrides.sp',
  16.635 +    'admin-simple.sp',
  16.636 +    'admin-users.sp',
  16.637 +  ]
  16.638 +)
  16.639 +CopyFiles('plugins/adminmenu', 'addons/sourcemod/scripting/adminmenu', ['dynamicmenu.sp'])
  16.640 +CopyFiles('plugins/testsuite', 'addons/sourcemod/scripting/testsuite',
  16.641 +  [ 'benchmark.sp',
  16.642 +    'bug4059.sp',
  16.643 +    'callfunctest.sp',
  16.644 +    'capstest.sp',
  16.645 +    'clientprefstest.sp',
  16.646 +    'cstrike-test.sp',
  16.647 +    'entpropelements.sp',
  16.648 +    'fakenative1.sp',
  16.649 +    'fakenative2.sp',
  16.650 +    'filetest.sp',
  16.651 +    'fwdtest1.sp',
  16.652 +    'fwdtest2.sp',
  16.653 +    'gamerules-props.sp',
  16.654 +    'goto_test.sp',
  16.655 +    'outputtest.sp',
  16.656 +    'ptstest.sp',
  16.657 +    'sorttest.sp',
  16.658 +    'sqltest.sp',
  16.659 +    'sqltest.sql',
  16.660 +    'stacktest.sp',
  16.661 +    'structtest.sp',
  16.662 +    'tf2-test.sp',
  16.663 +    'tries.sp',
  16.664 +  ]
  16.665 +)
  16.666 +CopyFiles('plugins/basecommands', 'addons/sourcemod/scripting/basecommands',
  16.667 +  [ 'cancelvote.sp',
  16.668 +    'execcfg.sp',
  16.669 +    'kick.sp',
  16.670 +    'map.sp',
  16.671 +    'reloadadmins.sp',
  16.672 +    'who.sp',
  16.673 +  ]
  16.674 +)
  16.675 +CopyFiles('plugins/basecomm', 'addons/sourcemod/scripting/basecomm',
  16.676 +  [ 'forwards.sp',
  16.677 +    'gag.sp',
  16.678 +    'natives.sp',
  16.679 +  ]
  16.680 +)
  16.681 +CopyFiles('plugins/funvotes', 'addons/sourcemod/scripting/funvotes',
  16.682 +  [ 'votealltalk.sp',
  16.683 +    'voteburn.sp',
  16.684 +    'voteff.sp',
  16.685 +    'votegravity.sp',
  16.686 +    'voteslay.sp',
  16.687 +  ]
  16.688 +)
  16.689 +CopyFiles('plugins/basevotes', 'addons/sourcemod/scripting/basevotes',
  16.690 +  [ 'voteban.sp',
  16.691 +    'votekick.sp',
  16.692 +    'votemap.sp',
  16.693 +  ]
  16.694 +)
  16.695 +CopyFiles('plugins/basebans', 'addons/sourcemod/scripting/basebans', ['ban.sp'])
  16.696 +CopyFiles('plugins/funcommands', 'addons/sourcemod/scripting/funcommands',
  16.697 +  [ 'beacon.sp',
  16.698 +    'blind.sp',
  16.699 +    'drug.sp',
  16.700 +    'fire.sp',
  16.701 +    'gravity.sp',
  16.702 +    'ice.sp',
  16.703 +    'noclip.sp',
  16.704 +    'timebomb.sp',
  16.705 +  ]
  16.706 +)
  16.707 +CopyFiles('plugins/playercommands', 'addons/sourcemod/scripting/playercommands',
  16.708 +  [ 'rename.sp',
  16.709 +    'slap.sp',
  16.710 +    'slay.sp',
  16.711 +  ]
  16.712 +)