Commit b9aea9a7 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Make proguard_configs explicit inputs for "gn analyze"

gn analyze does not use depfile information, which causes it to not know
that builds need to happen when proguard flags change.

To work around this, this change marks the proguard_configs as inputs to
(somewhat arbitrary) java actions.

Bug: 827197
Change-Id: I1522daa0e3782ac1989cf4e234d8409663bf1357
Reviewed-on: https://chromium-review.googlesource.com/985900Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547799}
parent b1de19fa
...@@ -1387,6 +1387,7 @@ if (enable_java_templates) { ...@@ -1387,6 +1387,7 @@ if (enable_java_templates) {
# possibly broken symlinks to them) get copied into the output # possibly broken symlinks to them) get copied into the output
# directory. # directory.
copy_ex(_output_jar_target) { copy_ex(_output_jar_target) {
forward_variables_from(invoker, [ "inputs" ])
deps = _deps deps = _deps
if (defined(invoker.deps)) { if (defined(invoker.deps)) {
deps += invoker.deps deps += invoker.deps
...@@ -2496,6 +2497,7 @@ if (enable_java_templates) { ...@@ -2496,6 +2497,7 @@ if (enable_java_templates) {
"main_class cannot be used for target of type ${invoker.type}") "main_class cannot be used for target of type ${invoker.type}")
} }
# The only target that might have no prebuilt and no sources is a java_binary.
if (_is_prebuilt || _has_sources) { if (_is_prebuilt || _has_sources) {
if (defined(invoker.output_name)) { if (defined(invoker.output_name)) {
_output_name = invoker.output_name _output_name = invoker.output_name
...@@ -2771,6 +2773,14 @@ if (enable_java_templates) { ...@@ -2771,6 +2773,14 @@ if (enable_java_templates) {
} }
output_jar_path = _final_jar_path output_jar_path = _final_jar_path
deps = _accumulated_deps deps = _accumulated_deps
# Although these will be listed as deps in the depfile, they must also
# appear here so that "gn analyze" knows about them.
# https://crbug.com/827197
if (defined(invoker.proguard_configs)) {
inputs = invoker.proguard_configs
deps += _srcjar_deps # For the aapt-generated proguard rules.
}
} }
_accumulated_deps += [ ":$_process_prebuilt_target_name" ] _accumulated_deps += [ ":$_process_prebuilt_target_name" ]
......
...@@ -1414,6 +1414,13 @@ if (enable_java_templates) { ...@@ -1414,6 +1414,13 @@ if (enable_java_templates) {
_build_config, _build_config,
] ]
# Although these will be listed as deps in the depfile, they must also
# appear here so that "gn analyze" knows about them.
# https://crbug.com/827197
if (defined(invoker.proguard_configs)) {
inputs += invoker.proguard_configs
}
output_jar_path = invoker.output output_jar_path = invoker.output
args = [ args = [
"--proguard-configs=@FileArg($_rebased_build_config:deps_info:proguard_all_configs)", "--proguard-configs=@FileArg($_rebased_build_config:deps_info:proguard_all_configs)",
...@@ -1543,6 +1550,13 @@ if (enable_java_templates) { ...@@ -1543,6 +1550,13 @@ if (enable_java_templates) {
_build_config, _build_config,
] ]
# Although these will be listed as deps in the depfile, they must also
# appear here so that "gn analyze" knows about them.
# https://crbug.com/827197
if (defined(invoker.proguard_configs)) {
inputs += invoker.proguard_configs
}
outputs = [ outputs = [
invoker.output, invoker.output,
] ]
...@@ -3254,6 +3268,9 @@ if (enable_java_templates) { ...@@ -3254,6 +3268,9 @@ if (enable_java_templates) {
"testonly", "testonly",
"visibility", "visibility",
]) ])
public_deps = [
":$_unpack_target_name",
]
deps = [] deps = []
if (defined(_jar_target_name)) { if (defined(_jar_target_name)) {
deps += [ ":$_jar_target_name" ] deps += [ ":$_jar_target_name" ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment