blob: b0076b2b81f7335f540a2191d458bb9001a6adde [file] [log] [blame]
Jim Van Verth443a9132017-11-28 09:45:26 -05001#!/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
8import os
9import sys
10
11# Arguments to the script:
12# app path to binary to package, e.g. out/Debug/gen/dm
Jim Van Verthb50e5cf2020-11-16 10:24:30 -050013# 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
15app,bundle_prefix = sys.argv[1:3]
Jim Van Verth443a9132017-11-28 09:45:26 -050016
17out, app = os.path.split(app)
18
19# Write a minimal Info.plist to name the package and point at the binary.
20with 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 Verthb50e5cf2020-11-16 10:24:30 -050027 <key>CFBundleIdentifier</key> <string>{bundle_prefix}.{app}</string>
Jim Van Verth443a9132017-11-28 09:45:26 -050028 <key>CFBundlePackageType</key> <string>APPL</string>
Jim Van Verth68cb8b02019-08-29 14:59:17 -040029 <key>LSRequiresIPhoneOS</key> <true/>
30 <key>UIDeviceFamily</key> <array>
31 <integer>1</integer>
32 <integer>2</integer>
33 </array>
Jim Van Verthe784f752019-09-05 09:37:31 -040034 <key>UILaunchStoryboardName</key> <string>LaunchScreen</string>
Jim Van Verth443a9132017-11-28 09:45:26 -050035 </dict>
36</plist>
Jim Van Verthb50e5cf2020-11-16 10:24:30 -050037'''.format(app=app, bundle_prefix=bundle_prefix))