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

Unified Diff: build/android/gyp/apkbuilder.py

Issue 1483683002: GN(android): Use list of libraries rather than native_lib_dir in all places (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review coments Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/gyp/pack_relocations.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/apkbuilder.py
diff --git a/build/android/gyp/apkbuilder.py b/build/android/gyp/apkbuilder.py
index 08577cde60a4b76272f7c4c77b3ff218c9037fe8..460d15769997a673b4451ed1907831730b0c0d8b 100755
--- a/build/android/gyp/apkbuilder.py
+++ b/build/android/gyp/apkbuilder.py
@@ -45,9 +45,10 @@ def _ParseArgs(args):
required=True)
parser.add_argument('--dex-file',
help='Path to the classes.dex to use')
- # TODO(agrieve): Switch this to be a list of files rather than a directory.
- parser.add_argument('--native-libs-dir',
- help='Directory containing native libraries to include',
+ parser.add_argument('--native-libs',
+ action='append',
+ help='GYP-list of native libraries to include. '
+ 'Can be specified multiple times.',
default=[])
parser.add_argument('--android-abi',
help='Android architecture to use for native libraries')
@@ -62,18 +63,17 @@ def _ParseArgs(args):
options.uncompressed_assets)
options.native_lib_placeholders = build_utils.ParseGypList(
options.native_lib_placeholders)
+ all_libs = []
+ for gyp_list in options.native_libs:
+ all_libs.extend(build_utils.ParseGypList(gyp_list))
+ options.native_libs = all_libs
- if not options.android_abi and (options.native_libs_dir or
+ if not options.android_abi and (options.native_libs or
options.native_lib_placeholders):
- raise Exception('Must specify --android-abi with --native-libs-dir')
+ raise Exception('Must specify --android-abi with --native-libs')
return options
-def _ListSubPaths(path):
- """Returns a list of full paths to all files in the given path."""
- return [os.path.join(path, name) for name in os.listdir(path)]
-
-
def _SplitAssetPath(path):
"""Returns (src, dest) given an asset path in the form src[:dest]."""
path_parts = path.split(':')
@@ -122,10 +122,7 @@ def main(args):
args = build_utils.ExpandFileArgs(args)
options = _ParseArgs(args)
- native_libs = []
- if options.native_libs_dir:
- native_libs = _ListSubPaths(options.native_libs_dir)
- native_libs.sort()
+ native_libs = sorted(options.native_libs)
input_paths = [options.resource_apk, __file__] + native_libs
if options.dex_file:
« no previous file with comments | « no previous file | build/android/gyp/pack_relocations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698