From: Mike Klein Date: Tue, 31 Jan 2017 17:07:33 +0000 (-0500) Subject: Automate more parts of gn/package_ios.py. X-Git-Tag: submit/tizen/20180928.044319~55^2~568 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63afe64a5f33a61235706dbec0f0cc695c88469b;p=platform%2Fupstream%2FlibSkiaSharp.git 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 Reviewed-by: Mike Klein --- 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'''Name +\tGoogle Development''', open(p).read(), re.MULTILINE): + mobileprovision = p +assert mobileprovision out, app = os.path.split(app)