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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//base/android/linker/config.gni") 5 import("//base/android/linker/config.gni")
6 import("//build/config/android/config.gni") 6 import("//build/config/android/config.gni")
7 import("//build/config/android/internal_rules.gni") 7 import("//build/config/android/internal_rules.gni")
8 import("//build/toolchain/toolchain.gni") 8 import("//build/toolchain/toolchain.gni")
9 import("//third_party/android_platform/config.gni") 9 import("//third_party/android_platform/config.gni")
10 import("//tools/grit/grit_rule.gni") 10 import("//tools/grit/grit_rule.gni")
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 gen_dir = "$target_gen_dir/$target_name" 1233 gen_dir = "$target_gen_dir/$target_name"
1234 base_path = "$gen_dir/$target_name" 1234 base_path = "$gen_dir/$target_name"
1235 _build_config = "$target_gen_dir/$target_name.build_config" 1235 _build_config = "$target_gen_dir/$target_name.build_config"
1236 resources_zip_path = "$base_path.resources.zip" 1236 resources_zip_path = "$base_path.resources.zip"
1237 _all_resources_zip_path = "$base_path.resources.all.zip" 1237 _all_resources_zip_path = "$base_path.resources.all.zip"
1238 _jar_path = "$base_path.jar" 1238 _jar_path = "$base_path.jar"
1239 _lib_dex_path = "$base_path.dex.jar" 1239 _lib_dex_path = "$base_path.dex.jar"
1240 _rebased_lib_dex_path = rebase_path(_lib_dex_path, root_build_dir) 1240 _rebased_lib_dex_path = rebase_path(_lib_dex_path, root_build_dir)
1241 _template_name = target_name 1241 _template_name = target_name
1242 1242
1243 final_dex_path = "$gen_dir/classes.dex" 1243 enable_multidex = defined(invoker.enable_multidex) && invoker.enable_multidex
1244 if (enable_multidex) {
1245 final_dex_path = "$gen_dir/classes.dex.zip"
1246 } else {
1247 final_dex_path = "$gen_dir/classes.dex"
1248 }
1244 final_dex_target_name = "${_template_name}__final_dex" 1249 final_dex_target_name = "${_template_name}__final_dex"
1245 1250
1246 _final_apk_path = "" 1251 _final_apk_path = ""
1247 if (defined(invoker.final_apk_path)) { 1252 if (defined(invoker.final_apk_path)) {
1248 _final_apk_path = invoker.final_apk_path 1253 _final_apk_path = invoker.final_apk_path
1249 } else if (defined(invoker.apk_name)) { 1254 } else if (defined(invoker.apk_name)) {
1250 _final_apk_path = "$root_build_dir/apks/" + invoker.apk_name + ".apk" 1255 _final_apk_path = "$root_build_dir/apks/" + invoker.apk_name + ".apk"
1251 } 1256 }
1252 _dist_jar_path_list = 1257 _dist_jar_path_list =
1253 process_file_template( 1258 process_file_template(
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir) 1549 rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir)
1545 args = [ 1550 args = [
1546 "--proguard-configs=$rebased_proguard_configs", 1551 "--proguard-configs=$rebased_proguard_configs",
1547 "--tested-apk-info=@FileArg($_rebased_build_config:proguard:tested_apk_i nfo)", 1552 "--tested-apk-info=@FileArg($_rebased_build_config:proguard:tested_apk_i nfo)",
1548 "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)", 1553 "--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)",
1549 ] 1554 ]
1550 } 1555 }
1551 _dex_sources = [ _proguard_jar_path ] 1556 _dex_sources = [ _proguard_jar_path ]
1552 _dex_deps = [ ":$_proguard_target" ] 1557 _dex_deps = [ ":$_proguard_target" ]
1553 } else { 1558 } else {
1554 _dex_sources = [ _lib_dex_path ] 1559 if (enable_multidex) {
1560 _dex_sources = [ _jar_path ]
1561 } else {
1562 _dex_sources = [ _lib_dex_path ]
1563 }
1555 _dex_deps = [ ":$java_target" ] 1564 _dex_deps = [ ":$java_target" ]
1556 } 1565 }
1557 1566
1558 dex("$final_dex_target_name") { 1567 dex("$final_dex_target_name") {
1568 forward_variables_from(invoker, [ "enable_multidex" ])
1559 deps = _dex_deps + [ ":$build_config_target" ] 1569 deps = _dex_deps + [ ":$build_config_target" ]
1560 inputs = [ 1570 inputs = [
1561 _build_config, 1571 _build_config,
1562 ] 1572 ]
1563 sources = _dex_sources 1573 sources = _dex_sources
1564 output = final_dex_path 1574 output = final_dex_path
1565 _dex_arg_key = "${_rebased_build_config}:final_dex:dependency_dex_files" 1575 if (enable_multidex) {
1576 _dex_arg_key = "${_rebased_build_config}:dist_jar:dependency_jars"
1577 } else {
1578 _dex_arg_key = "${_rebased_build_config}:final_dex:dependency_dex_files"
1579 }
1566 args = [ "--inputs=@FileArg($_dex_arg_key)" ] 1580 args = [ "--inputs=@FileArg($_dex_arg_key)" ]
1567 1581
1568 if (emma_coverage && !_emma_never_instrument) { 1582 if (emma_coverage && !_emma_never_instrument) {
1569 no_locals = true 1583 no_locals = true
1570 sources += [ "$android_sdk_root/tools/lib/emma_device.jar" ] 1584 sources += [ "$android_sdk_root/tools/lib/emma_device.jar" ]
1571 } 1585 }
1572 } 1586 }
1573 1587
1574 if (_native_libs != []) { 1588 if (_native_libs != []) {
1575 _prepare_native_target_name = "${_template_name}__prepare_native" 1589 _prepare_native_target_name = "${_template_name}__prepare_native"
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
2184 } 2198 }
2185 2199
2186 android_library(target_name) { 2200 android_library(target_name) {
2187 java_files = [] 2201 java_files = []
2188 srcjar_deps = [ ":${_template_name}__protoc_java" ] 2202 srcjar_deps = [ ":${_template_name}__protoc_java" ]
2189 deps = [ 2203 deps = [
2190 "//third_party/android_protobuf:protobuf_nano_javalib", 2204 "//third_party/android_protobuf:protobuf_nano_javalib",
2191 ] 2205 ]
2192 } 2206 }
2193 } 2207 }
OLDNEW
« 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