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

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: +comment in ChromiumMultiDex.template 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
« no previous file with comments | « build/android/main_dex_action.gypi ('k') | build/config/android/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 26ca8498ad8a7764ab409265bccca4018857c8f2..162201488a4ddbf22eb675babcf49e2ccd6d1f13 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -223,6 +223,51 @@ template("java_binary_script") {
template("dex") {
set_sources_assignment_filter([])
+ _enable_multidex = defined(invoker.enable_multidex) && invoker.enable_multidex
+
+ if (_enable_multidex) {
+ _main_dex_list_path = invoker.output + ".main_dex_list"
+ _main_dex_list_target_name = "${target_name}__main_dex_list"
+ action(_main_dex_list_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,
+ _main_dex_list_path,
+ ]
+
+ args = [
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--android-sdk-tools",
+ rebased_android_sdk_build_tools,
+ "--main-dex-list-path",
+ rebase_path(_main_dex_list_path, 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)
+ }
+ }
+ }
+
assert(defined(invoker.output))
action(target_name) {
forward_variables_from(invoker,
@@ -258,6 +303,16 @@ template("dex") {
args += [ "--no-locals=1" ]
}
+ if (_enable_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
}
« no previous file with comments | « build/android/main_dex_action.gypi ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698