PackageScript 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. ]
  11. # Create the distribution folder hierarchy.
  12. folder_map = {}
  13. for folder in folder_list:
  14. norm_folder = os.path.normpath(folder)
  15. folder_map[folder] = builder.AddFolder(norm_folder)
  16. # Do all straight-up file copies from the source tree.
  17. def CopyFiles(src, dest, files):
  18. if not dest:
  19. dest = src
  20. dest_entry = folder_map[dest]
  21. for source_file in files:
  22. source_path = os.path.join(builder.sourcePath, src, source_file)
  23. builder.AddCopy(source_path, dest_entry)
  24. CopyFiles('gamedata', 'addons/sourcemod/gamedata', [
  25. 'tf2.econ_dynamic.txt',
  26. ])
  27. CopyFiles('', 'addons/sourcemod/extensions', [
  28. 'tf2econdynamic.autoload',
  29. ])
  30. # Copy binaries.
  31. for cxx_task in Extension.extensions:
  32. builder.AddCopy(cxx_task.binary, folder_map['addons/sourcemod/extensions'])