Index: build/config/ios/codesign.py |
diff --git a/build/config/ios/codesign.py b/build/config/ios/codesign.py |
index 3d66b246837b4994b675ade0fba033198a087b11..5c486343a5474c6ea2ffa160975186b2ffe9316f 100644 |
--- a/build/config/ios/codesign.py |
+++ b/build/config/ios/codesign.py |
@@ -197,17 +197,37 @@ def CodeSignBundle(bundle_path, identity, extra_args): |
sys.stderr.write('\n') |
+def InstallSystemFrameworkOrLibrary(src_path, dst_path, args): |
+ """Install framework or library from |src_path| to |dst_path| and |
+ code-re-sign it.""" |
+ if os.path.isdir(dst_path): |
+ shutil.rmtree(dst_path) |
justincohen
2016/09/26 15:14:02
Is this the same thing Xcode does with it's build
sdefresne
2016/09/26 15:20:43
No, it put he asan library into ${app}.app/Framewo
justincohen
2016/09/26 16:09:00
Acknowledged.
|
+ elif os.path.isfile(dst_path): |
+ os.unlink(dst_path) |
+ |
+ if os.path.isdir(src_path): |
+ shutil.copytree(src_path, dst_path) |
+ else: |
+ shutil.copy(src_path, dst_path) |
+ |
+ CodeSignBundle(dst_path, args.identity, |
+ ['--deep', '--preserve-metadata=identifier,entitlements']) |
+ |
+ |
def InstallSystemFramework(framework_path, bundle_path, args): |
"""Install framework from |framework_path| to |bundle| and code-re-sign it.""" |
installed_framework_path = os.path.join( |
bundle_path, 'Frameworks', os.path.basename(framework_path)) |
+ InstallSystemFrameworkOrLibrary( |
+ framework_path, installed_framework_path, args) |
- if os.path.exists(installed_framework_path): |
- shutil.rmtree(installed_framework_path) |
- shutil.copytree(framework_path, installed_framework_path) |
- CodeSignBundle(installed_framework_path, args.identity, |
- ['--deep', '--preserve-metadata=identifier,entitlements']) |
+def InstallSystemLibrary(library_path, bundle_path, args): |
+ """Install library from |library_path| to |bundle| and code-re-sign it.""" |
+ installed_library_path = os.path.join( |
+ bundle_path, os.path.basename(library_path)) |
+ InstallSystemFrameworkOrLibrary( |
+ library_path, installed_library_path, args) |
def GenerateEntitlements(path, provisioning_profile, bundle_identifier): |
@@ -264,7 +284,10 @@ class CodeSignBundleAction(Action): |
help='path to the iOS bundle binary') |
parser.add_argument( |
'--framework', '-F', action='append', default=[], dest='frameworks', |
- help='install and resign system framework') |
+ help='install and re-sign system framework') |
+ parser.add_argument( |
+ '--library', '-L', action='append', default=[], dest='libraries', |
+ help='install and re-sign system libraries') |
parser.add_argument( |
'--disable-code-signature', action='store_false', dest='sign', |
help='disable code signature') |
@@ -298,6 +321,10 @@ class CodeSignBundleAction(Action): |
for framework_path in args.frameworks: |
InstallSystemFramework(framework_path, args.path, args) |
+ # Install system libraries if requested. |
+ for library_path in args.libraries: |
+ InstallSystemLibrary(library_path, args.path, args) |
+ |
# Copy main binary into bundle. |
if os.path.isfile(bundle.binary_path): |
os.unlink(bundle.binary_path) |