Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(687)

Unified Diff: build/config/ios/codesign.py

Issue 2363953004: Ensure the sanitizer runtime library is copied to app bundle if enabled. (Closed)
Patch Set: Address reviewers comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/config/ios/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/ios/codesign.py
diff --git a/build/config/ios/codesign.py b/build/config/ios/codesign.py
index 3d66b246837b4994b675ade0fba033198a087b11..5b553180a0b054c806bce4cc412606dddee55123 100644
--- a/build/config/ios/codesign.py
+++ b/build/config/ios/codesign.py
@@ -232,7 +232,6 @@ def GenerateEntitlements(path, provisioning_profile, bundle_identifier):
class Action(object):
-
"""Class implementing one action supported by the script."""
@classmethod
@@ -243,7 +242,6 @@ class Action(object):
class CodeSignBundleAction(Action):
-
"""Class implementing the code-sign-bundle action."""
name = 'code-sign-bundle'
@@ -321,8 +319,49 @@ class CodeSignBundleAction(Action):
CodeSignBundle(bundle.path, args.identity, codesign_extra_args)
-class GenerateEntitlementsAction(Action):
+class CodeSignFileAction(Action):
+ """Class implementing code signature for a single file."""
+
+ name = 'code-sign-file'
+ help = 'code-sign a single file'
+
+ @staticmethod
+ def _Register(parser):
+ parser.add_argument(
+ 'path', help='path to the file to codesign')
+ parser.add_argument(
+ '--identity', '-i', required=True,
+ help='identity to use to codesign')
+ parser.add_argument(
+ '--output', '-o',
+ help='if specified copy the file to that location before signing it')
+ parser.set_defaults(sign=True)
+ @staticmethod
+ def _Execute(args):
+ if not args.identity:
+ args.identity = '-'
+
+ install_path = args.path
+ if args.output:
+
+ if os.path.isfile(args.output):
+ os.unlink(args.output)
+ elif os.path.isdir(args.output):
+ shutil.rmtree(args.output)
+
+ if os.path.isfile(args.path):
+ shutil.copy(args.path, args.output)
+ elif os.path.isdir(args.path):
+ shutil.copytree(args.path, args.output)
+
+ install_path = args.output
+
+ CodeSignBundle(install_path, args.identity,
+ ['--deep', '--preserve-metadata=identifier,entitlements'])
+
+
+class GenerateEntitlementsAction(Action):
"""Class implementing the generate-entitlements action."""
name = 'generate-entitlements'
@@ -353,7 +392,13 @@ def Main():
parser = argparse.ArgumentParser('codesign iOS bundles')
subparsers = parser.add_subparsers()
- for action in [ CodeSignBundleAction, GenerateEntitlementsAction ]:
+ actions = [
+ CodeSignBundleAction,
+ CodeSignFileAction,
+ GenerateEntitlementsAction,
+ ]
+
+ for action in actions:
action.Register(subparsers)
args = parser.parse_args()
« no previous file with comments | « no previous file | build/config/ios/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698