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

Side by Side Diff: tools-webrtc/ios/build_ios_libs.py

Issue 2735173002: Update licence generation script after GYP->GN migration. (Closed)
Patch Set: Code review comments Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools-webrtc/ios/generate_licenses.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
tkchin_webrtc 2017/03/09 22:26:28 Is this arch dependent? (Or is there a way to make
208 license_script_path = os.path.join(os.path.dirname(SCRIPT_DIR),
209 'generate_licenses.py')
210 ninja_dir = os.path.join(args.output_dir, args.arch[0] + '_libs')
211 gn_target_full_name = '//webrtc/sdk:rtc_sdk_framework_objc'
212 cmd = [sys.executable, license_script_path, gn_target_full_name, ninja_dir,
213 os.path.join(args.output_dir, SDK_FRAMEWORK_NAME)]
214 _RunCommand(cmd)
215
207 # Modify the version number. 216 # Modify the version number.
208 # Format should be <Branch cut MXX>.<Hotfix #>.<Rev #>. 217 # Format should be <Branch cut MXX>.<Hotfix #>.<Rev #>.
209 # e.g. 55.0.14986 means branch cut 55, no hotfixes, and revision 14986. 218 # 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, 219 infoplist_path = os.path.join(args.output_dir, SDK_FRAMEWORK_NAME,
211 'Info.plist') 220 'Info.plist')
212 cmd = ['PlistBuddy', '-c', 221 cmd = ['PlistBuddy', '-c',
213 'Print :CFBundleShortVersionString', infoplist_path] 222 'Print :CFBundleShortVersionString', infoplist_path]
214 major_minor = subprocess.check_output(cmd).strip() 223 major_minor = subprocess.check_output(cmd).strip()
215 version_number = '%s.%s' % (major_minor, args.revision) 224 version_number = '%s.%s' % (major_minor, args.revision)
216 logging.info('Substituting revision number: %s', version_number) 225 logging.info('Substituting revision number: %s', version_number)
217 cmd = ['PlistBuddy', '-c', 226 cmd = ['PlistBuddy', '-c',
218 'Set :CFBundleVersion ' + version_number, infoplist_path] 227 'Set :CFBundleVersion ' + version_number, infoplist_path]
219 _RunCommand(cmd) 228 _RunCommand(cmd)
220 _RunCommand(['plutil', '-convert', 'binary1', infoplist_path]) 229 _RunCommand(['plutil', '-convert', 'binary1', infoplist_path])
221 230
222 logging.info('Done.') 231 logging.info('Done.')
223 return 0 232 return 0
224 233
225 234
226 if __name__ == '__main__': 235 if __name__ == '__main__':
227 sys.exit(main()) 236 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools-webrtc/ios/generate_licenses.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698