Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 3 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 4 # | 4 # |
| 5 # Use of this source code is governed by a BSD-style license | 5 # Use of this source code is governed by a BSD-style license |
| 6 # that can be found in the LICENSE file in the root of the source | 6 # that can be found in the LICENSE file in the root of the source |
| 7 # tree. An additional intellectual property rights grant can be found | 7 # tree. An additional intellectual property rights grant can be found |
| 8 # in the file PATENTS. All contributing project authors may | 8 # in the file PATENTS. All contributing project authors may |
| 9 # be found in the AUTHORS file in the root of the source tree. | 9 # be found in the AUTHORS file in the root of the source tree. |
| 10 | 10 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 'WebRTC') | 197 'WebRTC') |
| 198 lib_dsym_paths = [os.path.join(path, dsym_path) for path in lib_paths] | 198 lib_dsym_paths = [os.path.join(path, dsym_path) for path in lib_paths] |
| 199 out_dsym_path = os.path.join(args.output_dir, dsym_path) | 199 out_dsym_path = os.path.join(args.output_dir, dsym_path) |
| 200 try: | 200 try: |
| 201 os.remove(out_dsym_path) | 201 os.remove(out_dsym_path) |
| 202 except OSError: | 202 except OSError: |
| 203 pass | 203 pass |
| 204 cmd = ['lipo'] + lib_dsym_paths + ['-create', '-output', out_dsym_path] | 204 cmd = ['lipo'] + lib_dsym_paths + ['-create', '-output', out_dsym_path] |
| 205 _RunCommand(cmd) | 205 _RunCommand(cmd) |
| 206 | 206 |
| 207 # Generate the license file. | |
| 208 license_script_path = os.path.join( | |
| 209 os.path.dirname(os.path.realpath(__file__)), | |
|
kjellander_webrtc
2017/03/08 14:00:39
join with SCRIPT_DIR instead.
kthelgason
2017/03/09 14:45:54
Done.
| |
| 210 'generate_licenses.py') | |
| 211 ninja_dir = os.path.join(args.output_dir, args.arch[0] + '_libs') | |
| 212 gn_target_full_name = '//webrtc/sdk:rtc_sdk_framework_objc' | |
| 213 cmd = ['python', license_script_path, gn_target_full_name, ninja_dir, | |
|
kjellander_webrtc
2017/03/08 14:00:39
use sys.executable instead of 'python'
kthelgason
2017/03/09 14:45:54
Done.
| |
| 214 os.path.join(args.output_dir, SDK_FRAMEWORK_NAME)] | |
| 215 _RunCommand(cmd) | |
| 216 | |
| 207 # Modify the version number. | 217 # Modify the version number. |
| 208 # Format should be <Branch cut MXX>.<Hotfix #>.<Rev #>. | 218 # Format should be <Branch cut MXX>.<Hotfix #>.<Rev #>. |
| 209 # e.g. 55.0.14986 means branch cut 55, no hotfixes, and revision 14986. | 219 # e.g. 55.0.14986 means branch cut 55, no hotfixes, and revision 14986. |
| 210 infoplist_path = os.path.join(args.output_dir, SDK_FRAMEWORK_NAME, | 220 infoplist_path = os.path.join(args.output_dir, SDK_FRAMEWORK_NAME, |
| 211 'Info.plist') | 221 'Info.plist') |
| 212 cmd = ['PlistBuddy', '-c', | 222 cmd = ['PlistBuddy', '-c', |
| 213 'Print :CFBundleShortVersionString', infoplist_path] | 223 'Print :CFBundleShortVersionString', infoplist_path] |
| 214 major_minor = subprocess.check_output(cmd).strip() | 224 major_minor = subprocess.check_output(cmd).strip() |
| 215 version_number = '%s.%s' % (major_minor, args.revision) | 225 version_number = '%s.%s' % (major_minor, args.revision) |
| 216 logging.info('Substituting revision number: %s', version_number) | 226 logging.info('Substituting revision number: %s', version_number) |
| 217 cmd = ['PlistBuddy', '-c', | 227 cmd = ['PlistBuddy', '-c', |
| 218 'Set :CFBundleVersion ' + version_number, infoplist_path] | 228 'Set :CFBundleVersion ' + version_number, infoplist_path] |
| 219 _RunCommand(cmd) | 229 _RunCommand(cmd) |
| 220 _RunCommand(['plutil', '-convert', 'binary1', infoplist_path]) | 230 _RunCommand(['plutil', '-convert', 'binary1', infoplist_path]) |
| 221 | 231 |
| 222 logging.info('Done.') | 232 logging.info('Done.') |
| 223 return 0 | 233 return 0 |
| 224 | 234 |
| 225 | 235 |
| 226 if __name__ == '__main__': | 236 if __name__ == '__main__': |
| 227 sys.exit(main()) | 237 sys.exit(main()) |
| OLD | NEW |