Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 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 | |
| 8 | import os |
| 9 | import sys |
| 10 | |
| 11 | # Arguments to the script: |
| 12 | # app path to binary to package, e.g. out/Debug/gen/dm |
Jim Van Verth | b50e5cf | 2020-11-16 10:24:30 -0500 | [diff] [blame] | 13 | # bundle_prefix the first part of the bundle ID, e.g. com.google (no trailing '.') |
| 14 | # the app name will be appended to this to create the full bundle ID |
| 15 | app,bundle_prefix = sys.argv[1:3] |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 16 | |
| 17 | out, app = os.path.split(app) |
| 18 | |
| 19 | # Write a minimal Info.plist to name the package and point at the binary. |
| 20 | with open(os.path.join(out, app + '_Info.plist'), 'w') as f: |
| 21 | f.write(''' |
| 22 | <plist version="1.0"> |
| 23 | <dict> |
| 24 | <key>CFBundleVersion</key> <string>0.1.0</string> |
| 25 | <key>CFBundleShortVersionString</key> <string>0.1.0</string> |
| 26 | <key>CFBundleExecutable</key> <string>{app}</string> |
Jim Van Verth | b50e5cf | 2020-11-16 10:24:30 -0500 | [diff] [blame] | 27 | <key>CFBundleIdentifier</key> <string>{bundle_prefix}.{app}</string> |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 28 | <key>CFBundlePackageType</key> <string>APPL</string> |
Jim Van Verth | 68cb8b0 | 2019-08-29 14:59:17 -0400 | [diff] [blame] | 29 | <key>LSRequiresIPhoneOS</key> <true/> |
| 30 | <key>UIDeviceFamily</key> <array> |
| 31 | <integer>1</integer> |
| 32 | <integer>2</integer> |
| 33 | </array> |
Jim Van Verth | e784f75 | 2019-09-05 09:37:31 -0400 | [diff] [blame] | 34 | <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 35 | </dict> |
| 36 | </plist> |
Jim Van Verth | b50e5cf | 2020-11-16 10:24:30 -0500 | [diff] [blame] | 37 | '''.format(app=app, bundle_prefix=bundle_prefix)) |