PostprocessBuildPlayer_GA 745 B

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/python
  2. #Add required libraries to Xcode project during build for Google Analytics
  3. from mod_pbxproj import *
  4. from os import path, listdir
  5. from shutil import copytree
  6. import sys
  7. frameworks = [
  8. 'AdSupport.framework',
  9. 'CoreData.framework',
  10. 'SystemConfiguration.framework',
  11. 'libz.dylib',
  12. ]
  13. framework_dir = path.join(sys.argv[0],'..','..','Plugins','iOS')
  14. pbx_file_path = sys.argv[1] + '/Unity-iPhone.xcodeproj/project.pbxproj'
  15. pbx_object = XcodeProject.Load(pbx_file_path)
  16. pbx_object.add_framework_search_paths([path.abspath(framework_dir)])
  17. for framework in frameworks:
  18. pbx_object.add_file('System/Library/' + framework, tree='SDKROOT')
  19. pbx_object.save()