skia2/gn/gen_plist_ios.py
Jim Van Verth 443a913b8f Add create_bundle support for GN
Docs-Preview: https://skia.org/?cl=75383
Bug: skia:7339
Change-Id: I985734e8b7b5af21a82cb8ee59acbfb5ff1d3ff7
Reviewed-on: https://skia-review.googlesource.com/75383
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-11-28 15:29:07 +00:00

30 lines
852 B
Python

#!/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>
</dict>
</plist>
'''.format(app=app))