Chromium Code Reviews| Index: build/android/gyp/write_build_config.py |
| diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py |
| index b8363138567c9f01746931b0a384f007e03f3491..97f0fe88e62afcce8f5c2db2eab15f93199d8fc6 100755 |
| --- a/build/android/gyp/write_build_config.py |
| +++ b/build/android/gyp/write_build_config.py |
| @@ -36,6 +36,9 @@ import sys |
| from util import build_utils |
| +import write_ordered_libraries |
| + |
| + |
| dep_config_cache = {} |
| def GetDepConfig(path): |
| if not path in dep_config_cache: |
| @@ -74,6 +77,10 @@ def main(argv): |
| parser.add_option('--jar-path', help='Path to target\'s jar output.') |
| parser.add_option('--dex-path', help='Path to target\'s dex output.') |
| + # apk native library options |
| + parser.add_option('--native-libs', help='List of top-level native libs.') |
| + parser.add_option('--readelf-path', help='Path to toolchain\'s readelf.') |
| + |
| options, args = parser.parse_args(argv) |
| if args: |
| @@ -91,14 +98,15 @@ def main(argv): |
| 'android_apk': ['jar_path', 'dex_path', 'resources_zip'] |
| }[options.type] |
| + if options.native_libs: |
| + required_options += ['readelf_path'] |
| + |
| build_utils.CheckOptions(options, parser, required_options) |
| possible_deps_config_paths = build_utils.ParseGypList( |
| options.possible_deps_configs) |
| - |
| - |
| allow_unknown_deps = options.type == 'android_apk' |
| unknown_deps = [ |
| c for c in possible_deps_config_paths if not os.path.exists(c)] |
| @@ -157,6 +165,26 @@ def main(argv): |
| dex_deps_files = [c['dex_path'] for c in all_library_deps] |
| dex_config['dependency_dex_files'] = dex_deps_files |
| + library_paths = [] |
| + java_libraries_list = [] |
| + if options.native_libs: |
| + libraries = build_utils.ParseGypList(options.native_libs) |
| + libraries_dir = os.path.dirname(libraries[0]) |
|
newt (away)
2014/08/11 23:55:23
Is it safe to assume the libraries will all be in
cjhopman
2014/08/18 01:21:11
This is what we do in gyp. I don't think I like it
|
| + write_ordered_libraries.SetReadelfPath(options.readelf_path) |
| + write_ordered_libraries.SetLibraryDirs([libraries_dir]) |
| + all_native_library_deps = ( |
| + write_ordered_libraries.GetSortedTransitiveDependenciesForBinaries( |
| + libraries)) |
| + java_libraries_list = '{%s}' % ','.join( |
| + ['"%s"' % s for s in all_native_library_deps]) |
| + library_paths = map( |
| + write_ordered_libraries.FullLibraryPath, all_native_library_deps) |
| + |
| + config['native'] = { |
| + 'libraries': library_paths, |
|
newt (away)
2014/08/11 23:55:23
nit: I'd dedent this by 2 spaces and dedent the cl
cjhopman
2014/08/18 01:21:11
Me too. Done.
|
| + 'java_libraries_list': java_libraries_list |
| + } |
| + |
| build_utils.WriteJson(config, options.build_config, only_if_changed=True) |
| if options.depfile: |