plugins/AMBuilder
author David Anderson <dvander@alliedmods.net>
Mon Dec 30 17:50:59 2013 -0500 (2013-12-30)
changeset 4186 c6a694ae8566
parent 4185 07d958c9b498
child 4187 e70b65bc70b9
permissions -rw-r--r--
Port packaging to AMBuild 2 (bug 5997 part 6, r=ds).
     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.sourcePath, 'plugins', 'include'),
    34                          os.path.join(builder.buildPath, builder.buildFolder)),
    35   '-h',
    36 ]
    37 
    38 def build_plugin(script_path, smx_file):
    39   inputs = [
    40     SM.spcomp.binary,
    41     script_path,
    42   ]
    43   outputs = [
    44     smx_file
    45   ]
    46   argv = spcomp_argv + [script_path]
    47   cmd_entry, (smx_entry,) = builder.AddCommand(
    48     inputs = inputs,
    49     argv = argv,
    50     outputs = outputs,
    51     dep_type = 'msvc'
    52   )
    53   SM.smx_files[smx_file] = smx_entry
    54 
    55 for script_file in files:
    56   script_path = os.path.join(builder.currentSourcePath, script_file)
    57   smx_file = os.path.splitext(script_file)[0] + '.smx'
    58   build_plugin(script_path, smx_file)
    59 
    60 # This one has to be special.
    61 build_plugin(os.path.join(builder.currentSourcePath, 'admin-flatfile', 'admin-flatfile.sp'),
    62              'admin-flatfile.smx')