Index: build/config/ios/find_signing_identity.py |
diff --git a/build/config/ios/find_signing_identity.py b/build/config/ios/find_signing_identity.py |
index 736e2e4b5c919d96267da27a7ddb3aec4d0b7341..7add474b9c3723a05830d27efb9da3c62cee895a 100644 |
--- a/build/config/ios/find_signing_identity.py |
+++ b/build/config/ios/find_signing_identity.py |
@@ -19,7 +19,7 @@ def ListIdentities(): |
]) |
-def FindValidIdentity(): |
+def FindValidIdentity(identity_description): |
lines = list(map(str.strip, ListIdentities().splitlines())) |
# Look for something like "2) XYZ "iPhone Developer: Name (ABC)"" |
exp = re.compile('[0-9]+\) ([A-F0-9]+) "([^"]*)"') |
@@ -27,17 +27,21 @@ def FindValidIdentity(): |
res = exp.match(line) |
if res is None: |
continue |
- if "iPhone Developer" in res.group(2): |
- return res.group(1) |
- return "" |
+ if identity_description in res.group(2): |
+ yield res.group(1) |
if __name__ == '__main__': |
parser = argparse.ArgumentParser('codesign iOS bundles') |
- parser.add_argument('--developer_dir', required=False, |
- help='Path to Xcode.') |
+ parser.add_argument( |
+ '--developer_dir', required=False, |
+ help='Path to Xcode.') |
+ parser.add_argument( |
+ '--identity-description', required=True, |
+ help='Text description used to select the code signing identity.') |
args = parser.parse_args() |
if args.developer_dir: |
os.environ['DEVELOPER_DIR'] = args.developer_dir |
- print FindValidIdentity() |
+ for identity in FindValidIdentity(args.identity_description): |
+ print identity |