• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
8import os
9import sys
10
11# Arguments to the script:
12#  app              path to binary to package, e.g. out/Debug/gen/dm
13app, = sys.argv[1:]
14
15out, app = os.path.split(app)
16
17# Write a minimal Info.plist to name the package and point at the binary.
18with open(os.path.join(out, app + '_Info.plist'), 'w') as f:
19  f.write('''
20<plist version="1.0">
21  <dict>
22    <key>CFBundleVersion</key> <string>0.1.0</string>
23    <key>CFBundleShortVersionString</key> <string>0.1.0</string>
24    <key>CFBundleExecutable</key> <string>{app}</string>
25    <key>CFBundleIdentifier</key> <string>com.google.{app}</string>
26    <key>CFBundlePackageType</key> <string>APPL</string>
27    <key>LSRequiresIPhoneOS</key> <true/>
28    <key>UIDeviceFamily</key> <array>
29      <integer>1</integer>
30      <integer>2</integer>
31    </array>
32    <key>UILaunchStoryboardName</key> <string>LaunchScreen</string>
33  </dict>
34</plist>
35'''.format(app=app))
36