Skip to content

Commit

Permalink
Reland chromium#3 of Tweak GN deps of instrumentation apks
Browse files Browse the repository at this point in the history
Reland of https://codereview.chromium.org/1692383002/

This improves build concurrency a little bit.

TBR=jbudorick
BUG=none

Review URL: https://codereview.chromium.org/1702663002

Cr-Commit-Position: refs/heads/master@{#375669}
  • Loading branch information
agrieve authored and Commit bot committed Feb 16, 2016
1 parent 4425e20 commit 6044a02
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 0 additions & 2 deletions build/android/gyp/write_build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ def main(argv):
config['proguard'] = {}
proguard_config = config['proguard']
proguard_config['input_paths'] = [options.jar_path] + java_full_classpath
proguard_config['tested_apk_info'] = ''

# An instrumentation test apk should exclude the dex files that are in the apk
# under test.
Expand All @@ -456,7 +455,6 @@ def main(argv):
if tested_apk_config['proguard_enabled']:
assert proguard_enabled, ('proguard must be enabled for instrumentation'
' apks if it\'s enabled for the tested apk')
proguard_config['tested_apk_info'] = tested_apk_config['proguard_info']

# Dependencies for the final dex file of an apk or a 'deps_dex'.
if options.type in ['android_apk', 'deps_dex']:
Expand Down
2 changes: 1 addition & 1 deletion build/config/android/internal_rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ template("write_build_config") {
}

if (defined(invoker.apk_under_test)) {
deps += [ invoker.apk_under_test ]
deps += [ "${invoker.apk_under_test}__build_config" ]
apk_under_test_gen_dir =
get_label_info(invoker.apk_under_test, "target_gen_dir")
apk_under_test_name = get_label_info(invoker.apk_under_test, "name")
Expand Down
20 changes: 17 additions & 3 deletions build/config/android/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,9 @@ template("android_apk") {
if (defined(invoker.deps)) {
deps += invoker.deps
}
if (defined(invoker.apk_under_test)) {
deps += [ "${invoker.apk_under_test}__java" ]
}
}

# TODO(cjhopman): This is only ever needed to calculate the list of tests to
Expand Down Expand Up @@ -1626,12 +1629,23 @@ template("android_apk") {
] + _proguard_configs

output_jar_path = _proguard_jar_path
rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir)
_rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir)
args = [
"--proguard-configs=$rebased_proguard_configs",
"--tested-apk-info=@FileArg($_rebased_build_config:proguard:tested_apk_info)",
"--proguard-configs=$_rebased_proguard_configs",
"--input-paths=@FileArg($_rebased_build_config:proguard:input_paths)",
]
if (defined(invoker.apk_under_test)) {
deps += [
"${invoker.apk_under_test}__build_config",
"${invoker.apk_under_test}__proguard",
]
_apk_under_test_build_config =
get_label_info(invoker.apk_under_test, "target_gen_dir") + "/" +
get_label_info(invoker.apk_under_test, "name") + ".build_config"
_rebased_apk_under_test_build_config =
rebase_path(_apk_under_test_build_config, root_build_dir)
args += [ "--tested-apk-info=@FileArg($_rebased_apk_under_test_build_config:deps_info:proguard_info)" ]
}
}
_dex_sources = [ _proguard_jar_path ]
_dex_deps = [ ":$_proguard_target" ]
Expand Down

0 comments on commit 6044a02

Please sign in to comment.