gen_plist_ios.py 852 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env python2.7
  2. #
  3. # Copyright 2017 Google Inc.
  4. #
  5. # Use of this source code is governed by a BSD-style license that can be
  6. # found in the LICENSE file.
  7. import os
  8. import sys
  9. # Arguments to the script:
  10. # app path to binary to package, e.g. out/Debug/gen/dm
  11. app, = sys.argv[1:]
  12. out, app = os.path.split(app)
  13. # Write a minimal Info.plist to name the package and point at the binary.
  14. with open(os.path.join(out, app + '_Info.plist'), 'w') as f:
  15. f.write('''
  16. <plist version="1.0">
  17. <dict>
  18. <key>CFBundleVersion</key> <string>0.1.0</string>
  19. <key>CFBundleShortVersionString</key> <string>0.1.0</string>
  20. <key>CFBundleExecutable</key> <string>{app}</string>
  21. <key>CFBundleIdentifier</key> <string>com.google.{app}</string>
  22. <key>CFBundlePackageType</key> <string>APPL</string>
  23. </dict>
  24. </plist>
  25. '''.format(app=app))