aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-01-31 12:07:33 -0500
committerGravatar Mike Klein <mtklein@chromium.org>2017-01-31 17:41:16 +0000
commit63afe64a5f33a61235706dbec0f0cc695c88469b (patch)
treed1830e95ca6bca60d1eb7918f8ff49ee5157f5b0 /gn
parent6de99041f13e87ed440f7db13a07693c6c4c461a (diff)
Automate more parts of gn/package_ios.py.
We can determine the signing identity by running 'security', and can find an installed mobile provisioning profile by looking in the directory where they're installed. Change-Id: Ia6a4579ef1918b5337cdf8745ac1e39743b38252 Reviewed-on: https://skia-review.googlesource.com/7798 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn')
-rw-r--r--gn/package_ios.py23
1 files changed, 19 insertions, 4 deletions
diff --git a/gn/package_ios.py b/gn/package_ios.py
index ee8ab46b88..f89656e883 100644
--- a/gn/package_ios.py
+++ b/gn/package_ios.py
@@ -5,6 +5,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import glob
import os
import re
import shutil
@@ -14,10 +15,24 @@ import tempfile
# Arguments to the script:
# app path to binary to package, e.g. out/Debug/dm
-# identity code signing identity, a long hex string
-# (run security find-identity -v -p codesigning | grep Google)
-# mobileprovision path to Google_Development.mobileprovision
-app, identity, mobileprovision = sys.argv[1:]
+app, = sys.argv[1:]
+
+# Find the Google signing identity.
+identity = None
+for line in subprocess.check_output(['security', 'find-identity']).split('\n'):
+ m = re.match(r'''.*\) (.*) ".*Google.*"''', line)
+ if m:
+ identity = m.group(1)
+assert identity
+
+# Find the Google mobile provisioning profile.
+mobileprovision = None
+for p in glob.glob(os.path.join(os.environ['HOME'], 'Library', 'MobileDevice',
+ 'Provisioning Profiles', '*.mobileprovision')):
+ if re.search(r'''<key>Name</key>
+\t<string>Google Development</string>''', open(p).read(), re.MULTILINE):
+ mobileprovision = p
+assert mobileprovision
out, app = os.path.split(app)