skia2/gn/gen_plist_ios.py
Hal Canary 389c8e9d2d [minor] mark scripts as executable
if a filename ends with `.py` and  the file begins with '#!.*python.*',
make it executable.

Change-Id: I41de516ff37343d3b0979bde9fd61813aec7365c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254439
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-11-21 17:06:27 +00:00

36 lines
1.0 KiB
Python
Executable File

#!/usr/bin/env python2.7
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
# Arguments to the script:
# app path to binary to package, e.g. out/Debug/gen/dm
app, = sys.argv[1:]
out, app = os.path.split(app)
# Write a minimal Info.plist to name the package and point at the binary.
with open(os.path.join(out, app + '_Info.plist'), 'w') as f:
f.write('''
<plist version="1.0">
<dict>
<key>CFBundleVersion</key> <string>0.1.0</string>
<key>CFBundleShortVersionString</key> <string>0.1.0</string>
<key>CFBundleExecutable</key> <string>{app}</string>
<key>CFBundleIdentifier</key> <string>com.google.{app}</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>LSRequiresIPhoneOS</key> <true/>
<key>UIDeviceFamily</key> <array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UILaunchStoryboardName</key> <string>LaunchScreen</string>
</dict>
</plist>
'''.format(app=app))