PackageScript 1.1 KB

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