Chromium Code Reviews

Side by Side Diff: tools_webrtc/ios/build_ios_libs.py

Issue 3011613002: License generation script for build_aar.py. (Closed)
Patch Set: License generation script for build_aar.py Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 206 matching lines...)
217 lib_dsym_paths = [os.path.join(path, dsym_path) for path in lib_paths] 217 lib_dsym_paths = [os.path.join(path, dsym_path) for path in lib_paths]
218 out_dsym_path = os.path.join(args.output_dir, dsym_path) 218 out_dsym_path = os.path.join(args.output_dir, dsym_path)
219 try: 219 try:
220 os.remove(out_dsym_path) 220 os.remove(out_dsym_path)
221 except OSError: 221 except OSError:
222 pass 222 pass
223 cmd = ['lipo'] + lib_dsym_paths + ['-create', '-output', out_dsym_path] 223 cmd = ['lipo'] + lib_dsym_paths + ['-create', '-output', out_dsym_path]
224 _RunCommand(cmd) 224 _RunCommand(cmd)
225 225
226 # Generate the license file. 226 # Generate the license file.
227 license_script_path = os.path.join(SCRIPT_DIR, 'generate_licenses.py') 227 license_script_path = os.path.join(SCRIPT_DIR, '..', 'generate_licenses.py')
228 ninja_dirs = [os.path.join(args.output_dir, arch + '_libs') 228 ninja_dirs = [os.path.join(args.output_dir, arch + '_libs')
229 for arch in architectures] 229 for arch in architectures]
230 gn_target_full_name = '//webrtc/sdk:' + gn_target_name 230 gn_target_full_name = '//webrtc/sdk:' + gn_target_name
231 cmd = [sys.executable, license_script_path, gn_target_full_name, 231 cmd = [sys.executable, license_script_path, '--target', gn_target_full_name,
232 os.path.join(args.output_dir, SDK_FRAMEWORK_NAME)] + ninja_dirs 232 os.path.join(args.output_dir, SDK_FRAMEWORK_NAME)] + ninja_dirs
233 _RunCommand(cmd) 233 _RunCommand(cmd)
234 234
235 # Modify the version number. 235 # Modify the version number.
236 # Format should be <Branch cut MXX>.<Hotfix #>.<Rev #>. 236 # Format should be <Branch cut MXX>.<Hotfix #>.<Rev #>.
237 # e.g. 55.0.14986 means branch cut 55, no hotfixes, and revision 14986. 237 # e.g. 55.0.14986 means branch cut 55, no hotfixes, and revision 14986.
238 infoplist_path = os.path.join(args.output_dir, SDK_FRAMEWORK_NAME, 238 infoplist_path = os.path.join(args.output_dir, SDK_FRAMEWORK_NAME,
239 'Info.plist') 239 'Info.plist')
240 cmd = ['PlistBuddy', '-c', 240 cmd = ['PlistBuddy', '-c',
241 'Print :CFBundleShortVersionString', infoplist_path] 241 'Print :CFBundleShortVersionString', infoplist_path]
242 major_minor = subprocess.check_output(cmd).strip() 242 major_minor = subprocess.check_output(cmd).strip()
243 version_number = '%s.%s' % (major_minor, args.revision) 243 version_number = '%s.%s' % (major_minor, args.revision)
244 logging.info('Substituting revision number: %s', version_number) 244 logging.info('Substituting revision number: %s', version_number)
245 cmd = ['PlistBuddy', '-c', 245 cmd = ['PlistBuddy', '-c',
246 'Set :CFBundleVersion ' + version_number, infoplist_path] 246 'Set :CFBundleVersion ' + version_number, infoplist_path]
247 _RunCommand(cmd) 247 _RunCommand(cmd)
248 _RunCommand(['plutil', '-convert', 'binary1', infoplist_path]) 248 _RunCommand(['plutil', '-convert', 'binary1', infoplist_path])
249 249
250 logging.info('Done.') 250 logging.info('Done.')
251 return 0 251 return 0
252 252
253 253
254 if __name__ == '__main__': 254 if __name__ == '__main__':
255 sys.exit(main()) 255 sys.exit(main())
OLDNEW

Powered by Google App Engine