PackageScript 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. ]
  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('', 'addons/metamod', [
  26. 'tf2dynschema.vdf', ## !CHANGEME! if you want to add the VDF loader
  27. ])
  28. # Copy binaries.
  29. for cxx_task in MMS.binaries:
  30. builder.AddCopy(cxx_task.binary, folder_map[mms_plugin_directory + '/bin'])