plugins/AMBuilder
author Ruben Gonzalez <drifter01620@gmail.com>
Thu May 22 09:49:27 2014 -0400 (2014-05-22)
changeset 4378 568f4497ef4a
parent 4187 e70b65bc70b9
permissions -rw-r--r--
Update CS:GO team score gamedata.
     1 # vim: set ts=8 sts=2 sw=2 tw=99 et ft=python: 
     2 import os
     3 
     4 files = [
     5   'adminhelp.sp',
     6   'antiflood.sp',
     7   'basecomm.sp',
     8   'clientprefs.sp',
     9   'nextmap.sp',
    10   'reservedslots.sp',
    11   'adminmenu.sp',
    12   'basebans.sp',
    13   'basetriggers.sp',
    14   'funcommands.sp',
    15   'nominations.sp',
    16   'rockthevote.sp',
    17   'admin-sql-prefetch.sp',
    18   'basechat.sp',
    19   'basevotes.sp',
    20   'funvotes.sp',
    21   'playercommands.sp',
    22   'sounds.sp',
    23   'admin-sql-threaded.sp',
    24   'basecommands.sp',
    25   'mapchooser.sp',
    26   'randomcycle.sp',
    27   'sql-admin-manager.sp'
    28 ]
    29 
    30 spcomp_argv = [
    31   os.path.join(builder.buildPath, SM.spcomp.binary.path),
    32   'SM_GENERATED_BUILD=',
    33   '-i' + os.path.relpath(os.path.join(builder.buildPath, 'includes'),
    34                          os.path.join(builder.buildPath, builder.buildFolder)),
    35   '-i' + os.path.relpath(os.path.join(builder.sourcePath, 'plugins', 'include'),
    36                          os.path.join(builder.buildPath, builder.buildFolder)),
    37   '-h',
    38 ]
    39 
    40 def build_plugin(script_path, smx_file):
    41   inputs = [
    42     SM.spcomp.binary,
    43     script_path,
    44   ]
    45   outputs = [
    46     smx_file
    47   ]
    48   argv = spcomp_argv + [script_path]
    49   cmd_entry, (smx_entry,) = builder.AddCommand(
    50     inputs = inputs,
    51     argv = argv,
    52     outputs = outputs,
    53     dep_type = 'msvc',
    54     weak_inputs = SM.generated_headers
    55   )
    56   SM.smx_files[smx_file] = smx_entry
    57 
    58 for script_file in files:
    59   script_path = os.path.join(builder.currentSourcePath, script_file)
    60   smx_file = os.path.splitext(script_file)[0] + '.smx'
    61   build_plugin(script_path, smx_file)
    62 
    63 # This one has to be special.
    64 build_plugin(os.path.join(builder.currentSourcePath, 'admin-flatfile', 'admin-flatfile.sp'),
    65              'admin-flatfile.smx')