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

Side by Side Diff: build/android/gyp/write_build_config.py

Issue 2327063002: Revert of Make secondary abi work for component build (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « build/android/BUILD.gn ('k') | build/config/android/internal_rules.gni » ('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 2014 The Chromium Authors. All rights reserved. 3 # Copyright 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Writes a build_config file. 7 """Writes a build_config file.
8 8
9 The build_config file for a target is a json file containing information about 9 The build_config file for a target is a json file containing information about
10 how to build that target based on the target's dependencies. This includes 10 how to build that target based on the target's dependencies. This includes
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 for path in runtime_deps_files: 202 for path in runtime_deps_files:
203 with open(path) as f: 203 with open(path) as f:
204 for line in f: 204 for line in f:
205 line = line.rstrip() 205 line = line.rstrip()
206 if not line.endswith('.so'): 206 if not line.endswith('.so'):
207 continue 207 continue
208 ret.append(os.path.normpath(line)) 208 ret.append(os.path.normpath(line))
209 ret.reverse() 209 ret.reverse()
210 return ret 210 return ret
211 211
212 def _CreateJavaLibrariesList(library_paths):
213 """ Create a java literal array with the "base" library names:
214 e.g. libfoo.so -> foo
215 """
216 return ('{%s}' % ','.join(['"%s"' % s[3:-3] for s in library_paths]))
217 212
218 def main(argv): 213 def main(argv):
219 parser = optparse.OptionParser() 214 parser = optparse.OptionParser()
220 build_utils.AddDepfileOption(parser) 215 build_utils.AddDepfileOption(parser)
221 parser.add_option('--build-config', help='Path to build_config output.') 216 parser.add_option('--build-config', help='Path to build_config output.')
222 parser.add_option( 217 parser.add_option(
223 '--type', 218 '--type',
224 help='Type of this target (e.g. android_library).') 219 help='Type of this target (e.g. android_library).')
225 parser.add_option( 220 parser.add_option(
226 '--deps-configs', 221 '--deps-configs',
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 help='GYP-list of .jar files to include on the classpath when compiling, ' 257 help='GYP-list of .jar files to include on the classpath when compiling, '
263 'but not to include in the final binary.') 258 'but not to include in the final binary.')
264 259
265 # android library options 260 # android library options
266 parser.add_option('--dex-path', help='Path to target\'s dex output.') 261 parser.add_option('--dex-path', help='Path to target\'s dex output.')
267 262
268 # native library options 263 # native library options
269 parser.add_option('--shared-libraries-runtime-deps', 264 parser.add_option('--shared-libraries-runtime-deps',
270 help='Path to file containing runtime deps for shared ' 265 help='Path to file containing runtime deps for shared '
271 'libraries.') 266 'libraries.')
272 parser.add_option('--secondary-abi-shared-libraries-runtime-deps',
273 help='Path to file containing runtime deps for secondary '
274 'abi shared libraries.')
275 267
276 # apk options 268 # apk options
277 parser.add_option('--apk-path', help='Path to the target\'s apk output.') 269 parser.add_option('--apk-path', help='Path to the target\'s apk output.')
278 parser.add_option('--incremental-apk-path', 270 parser.add_option('--incremental-apk-path',
279 help="Path to the target's incremental apk output.") 271 help="Path to the target's incremental apk output.")
280 parser.add_option('--incremental-install-script-path', 272 parser.add_option('--incremental-install-script-path',
281 help="Path to the target's generated incremental install " 273 help="Path to the target's generated incremental install "
282 "script.") 274 "script.")
283 275
284 parser.add_option('--tested-apk-config', 276 parser.add_option('--tested-apk-config',
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 if not options.tested_apk_config and manifest.GetInstrumentation(): 622 if not options.tested_apk_config and manifest.GetInstrumentation():
631 # This must then have instrumentation only for itself. 623 # This must then have instrumentation only for itself.
632 manifest.CheckInstrumentation(manifest.GetPackageName()) 624 manifest.CheckInstrumentation(manifest.GetPackageName())
633 625
634 library_paths = [] 626 library_paths = []
635 java_libraries_list = None 627 java_libraries_list = None
636 runtime_deps_files = build_utils.ParseGnList( 628 runtime_deps_files = build_utils.ParseGnList(
637 options.shared_libraries_runtime_deps or '[]') 629 options.shared_libraries_runtime_deps or '[]')
638 if runtime_deps_files: 630 if runtime_deps_files:
639 library_paths = _ExtractSharedLibsFromRuntimeDeps(runtime_deps_files) 631 library_paths = _ExtractSharedLibsFromRuntimeDeps(runtime_deps_files)
640 java_libraries_list = _CreateJavaLibrariesList(library_paths) 632 # Create a java literal array with the "base" library names:
641 633 # e.g. libfoo.so -> foo
642 secondary_abi_library_paths = [] 634 java_libraries_list = ('{%s}' % ','.join(
643 secondary_abi_java_libraries_list = None 635 ['"%s"' % s[3:-3] for s in library_paths]))
644 secondary_abi_runtime_deps_files = build_utils.ParseGnList(
645 options.secondary_abi_shared_libraries_runtime_deps or '[]')
646 if secondary_abi_runtime_deps_files:
647 secondary_abi_library_paths = _ExtractSharedLibsFromRuntimeDeps(
648 secondary_abi_runtime_deps_files)
649 secondary_abi_java_libraries_list = _CreateJavaLibrariesList(
650 secondary_abi_library_paths)
651 636
652 all_inputs.extend(runtime_deps_files) 637 all_inputs.extend(runtime_deps_files)
653 config['native'] = { 638 config['native'] = {
654 'libraries': library_paths, 639 'libraries': library_paths,
655 'secondary_abi_libraries': secondary_abi_library_paths,
656 'java_libraries_list': java_libraries_list, 640 'java_libraries_list': java_libraries_list,
657 'secondary_abi_java_libraries_list': secondary_abi_java_libraries_list,
658 } 641 }
659 config['assets'], config['uncompressed_assets'] = ( 642 config['assets'], config['uncompressed_assets'] = (
660 _MergeAssets(deps.All('android_assets'))) 643 _MergeAssets(deps.All('android_assets')))
661 644
662 build_utils.WriteJson(config, options.build_config, only_if_changed=True) 645 build_utils.WriteJson(config, options.build_config, only_if_changed=True)
663 646
664 if options.depfile: 647 if options.depfile:
665 build_utils.WriteDepfile(options.depfile, all_inputs) 648 build_utils.WriteDepfile(options.depfile, all_inputs)
666 649
667 650
668 if __name__ == '__main__': 651 if __name__ == '__main__':
669 sys.exit(main(sys.argv[1:])) 652 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « build/android/BUILD.gn ('k') | build/config/android/internal_rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698