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

Unified Diff: build/config/android/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/config/android/internal_rules.gni ('k') | chrome/android/chrome_public_apk_tmpl.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/rules.gni
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index 2dd616b6e168b95a58ff1ea305b5bfd20ca661b0..6947a533e29bb0a415e283d28f25cf1da04f6d3e 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -1240,7 +1240,12 @@ template("android_apk") {
_rebased_lib_dex_path = rebase_path(_lib_dex_path, root_build_dir)
_template_name = target_name
- final_dex_path = "$gen_dir/classes.dex"
+ enable_multidex = defined(invoker.enable_multidex) && invoker.enable_multidex
+ if (enable_multidex) {
+ final_dex_path = "$gen_dir/classes.dex.zip"
+ } else {
+ final_dex_path = "$gen_dir/classes.dex"
+ }
final_dex_target_name = "${_template_name}__final_dex"
_final_apk_path = ""
@@ -1551,18 +1556,27 @@ template("android_apk") {
_dex_sources = [ _proguard_jar_path ]
_dex_deps = [ ":$_proguard_target" ]
} else {
- _dex_sources = [ _lib_dex_path ]
+ if (enable_multidex) {
+ _dex_sources = [ _jar_path ]
+ } else {
+ _dex_sources = [ _lib_dex_path ]
+ }
_dex_deps = [ ":$java_target" ]
}
dex("$final_dex_target_name") {
+ forward_variables_from(invoker, [ "enable_multidex" ])
deps = _dex_deps + [ ":$build_config_target" ]
inputs = [
_build_config,
]
sources = _dex_sources
output = final_dex_path
- _dex_arg_key = "${_rebased_build_config}:final_dex:dependency_dex_files"
+ if (enable_multidex) {
+ _dex_arg_key = "${_rebased_build_config}:dist_jar:dependency_jars"
+ } else {
+ _dex_arg_key = "${_rebased_build_config}:final_dex:dependency_dex_files"
+ }
args = [ "--inputs=@FileArg($_dex_arg_key)" ]
if (emma_coverage && !_emma_never_instrument) {
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | chrome/android/chrome_public_apk_tmpl.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698