PackageScript 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # vim: set ts=8 sts=2 sw=2 tw=99 et ft=python:
  2. import os
  3. mms_plugin_directory = 'addons/dynattrs'
  4. # This is where the files will be output to
  5. # package is the default
  6. builder.SetBuildFolder('package')
  7. # Add any folders you need to this list
  8. folder_list = [
  9. mms_plugin_directory + '/bin',
  10. 'addons/metamod', ## !CHANGEME! if you want to add the VDF loader
  11. 'addons/sourcemod/gamedata',
  12. ]
  13. # Create the distribution folder hierarchy.
  14. folder_map = {}
  15. for folder in folder_list:
  16. norm_folder = os.path.normpath(folder)
  17. folder_map[folder] = builder.AddFolder(norm_folder)
  18. # Do all straight-up file copies from the source tree.
  19. def CopyFiles(src, dest, files):
  20. if not dest:
  21. dest = src
  22. dest_entry = folder_map[dest]
  23. for source_file in files:
  24. source_path = os.path.join(builder.sourcePath, src, source_file)
  25. builder.AddCopy(source_path, dest_entry)
  26. CopyFiles('', 'addons/metamod', [
  27. 'tf2dynschema.vdf', ## !CHANGEME! if you want to add the VDF loader
  28. ])
  29. CopyFiles('gamedata', 'addons/sourcemod/gamedata', [
  30. 'tf2.econ_dynamic.txt',
  31. ])
  32. # Copy binaries.
  33. for cxx_task in MMS.binaries:
  34. builder.AddCopy(cxx_task.binary, folder_map[mms_plugin_directory + '/bin'])