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

Unified Diff: build/config/android/internal_rules.gni

Issue 1451483002: [Android] Add gn support for multidex. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: @ Created 5 years, 1 month 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
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 9895c460102fa50a4095bd405efe364986a8d9e1..17a1335e83b756da4993b17cc01f5a9f99d61b19 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -223,6 +223,63 @@ template("java_binary_script") {
template("dex") {
set_sources_assignment_filter([])
+ _multidex = defined(invoker.multidex) && invoker.multidex
agrieve 2015/11/16 19:02:33 nit: It would be more GN'y to call this "enable_mu
jbudorick 2015/11/16 20:45:56 I'm still getting a handle on what's GN'y. switche
+
+ if (_multidex) {
+ _main_dex_list_path = invoker.output + ".main_dex_list"
+ template("main_dex_list_helper") {
agrieve 2015/11/16 19:02:33 doesn't look like this is used more than once, so
jbudorick 2015/11/16 20:45:56 I'm not. I think I patterned this off of something
+ action(target_name) {
+ forward_variables_from(invoker,
+ [
+ "deps",
+ "inputs",
+ "sources",
+ "testonly",
+ ])
+
+ script = "//build/android/gyp/main_dex_list.py"
+ depfile = "$target_gen_dir/$target_name.d"
+
+ main_dex_rules = "//build/android/main_dex_classes.flags"
+
+ outputs = [
+ depfile,
+ invoker.output,
+ ]
+
+ args = [
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--android-sdk-tools",
+ rebased_android_sdk_build_tools,
+ "--main-dex-list-path",
+ rebase_path(invoker.output, root_build_dir),
+ "--main-dex-rules-path",
+ rebase_path(main_dex_rules, root_build_dir),
+ ]
+
+ if (defined(invoker.args)) {
+ args += invoker.args
+ }
+
+ if (defined(invoker.sources)) {
+ args += rebase_path(invoker.sources, root_build_dir)
+ }
+ }
+ }
+
+ _main_dex_list_target_name = "${target_name}__main_dex_list"
+ main_dex_list_helper(_main_dex_list_target_name) {
+ forward_variables_from(invoker,
+ [
+ "args",
+ "sources",
+ ])
+ output = _main_dex_list_path
+ deps = invoker.deps
+ }
+ }
+
assert(defined(invoker.output))
action(target_name) {
forward_variables_from(invoker,
@@ -258,6 +315,16 @@ template("dex") {
args += [ "--no-locals=1" ]
}
+ if (defined(invoker.multidex) && invoker.multidex) {
+ args += [
+ "--multi-dex",
+ "--main-dex-list-path",
+ rebase_path(_main_dex_list_path, root_build_dir),
+ ]
+ deps += [ ":${_main_dex_list_target_name}" ]
+ inputs += [ _main_dex_list_path ]
+ }
+
if (defined(invoker.args)) {
args += invoker.args
}

Powered by Google App Engine
This is Rietveld 408576698