Commit 7c1d9ee7 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: GN: Allow errorprone_args to be different than javac_args

Bug: 906803
Change-Id: I5a9c315008a6908e2bb3aef7ac9726e20b6c1cfc
Reviewed-on: https://chromium-review.googlesource.com/c/1349672Reviewed-by: default avatarEric Stevenson <estevenson@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610625}
parent 5ab2b206
...@@ -2844,6 +2844,8 @@ if (enable_java_templates) { ...@@ -2844,6 +2844,8 @@ if (enable_java_templates) {
# supports_android: Optional. True if target can run on Android. # supports_android: Optional. True if target can run on Android.
# requires_android: Optional. True if target can only run on Android. # requires_android: Optional. True if target can only run on Android.
# java_files: Optional list of Java source file paths for this target. # java_files: Optional list of Java source file paths for this target.
# javac_args: Optional list of extra arguments to pass to javac.
# errorprone_args: Optional list of extra arguments to pass to .
# srcjar_deps: Optional list of .srcjar targets (not file paths). The Java # srcjar_deps: Optional list of .srcjar targets (not file paths). The Java
# source files they contain will also be compiled for this target. # source files they contain will also be compiled for this target.
# java_sources_file: Optional path to a file which will be written with # java_sources_file: Optional path to a file which will be written with
...@@ -3271,6 +3273,12 @@ if (enable_java_templates) { ...@@ -3271,6 +3273,12 @@ if (enable_java_templates) {
compile_java_helper(_compile_java_errorprone_target) { compile_java_helper(_compile_java_errorprone_target) {
forward_variables_from(invoker, _compile_java_forward_variables) forward_variables_from(invoker, _compile_java_forward_variables)
enable_errorprone = true enable_errorprone = true
if (defined(invoker.errorprone_args)) {
if (!defined(javac_args)) {
javac_args = []
}
javac_args += invoker.errorprone_args
}
javac_jar_path = _javac_jar_path + ".errorprone.jar" javac_jar_path = _javac_jar_path + ".errorprone.jar"
} }
_analysis_public_deps += [ ":$_compile_java_errorprone_target" ] _analysis_public_deps += [ ":$_compile_java_errorprone_target" ]
......
...@@ -1392,6 +1392,7 @@ if (enable_java_templates) { ...@@ -1392,6 +1392,7 @@ if (enable_java_templates) {
# [ [ path_to_file, path_to_put_in_jar ] ] # [ [ path_to_file, path_to_put_in_jar ] ]
# #
# javac_args: Additional arguments to pass to javac. # javac_args: Additional arguments to pass to javac.
# errorprone_args: Additional arguments to pass to errorprone.
# #
# data_deps, testonly # data_deps, testonly
# #
...@@ -3100,27 +3101,8 @@ if (enable_java_templates) { ...@@ -3100,27 +3101,8 @@ if (enable_java_templates) {
# #
# This target creates an Android instrumentation test apk. # This target creates an Android instrumentation test apk.
# #
# Variables # Supports all variables of android_apk(), plus:
# android_manifest: Path to AndroidManifest.xml. # apk_under_test: The apk being tested (optional).
# data_deps: List of dependencies needed at runtime. These will be built but
# won't change the generated .apk in any way (in fact they may be built
# after the .apk is).
# deps: List of dependencies. All Android java resources and libraries in the
# "transitive closure" of these dependencies will be included in the apk.
# Note: this "transitive closure" actually only includes such targets if
# they are depended on through android_library or android_resources targets
# (and so not through builtin targets like 'action', 'group', etc).
# java_files: List of .java files to include in the apk.
# srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
# will be added to java_files and be included in this apk.
# apk_name: Name for final apk.
# final_apk_path: Path to final built apk. Default is
# $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name.
# shared_libraries: List shared_library targets to bundle. If these
# libraries depend on other shared_library targets, those dependencies will
# also be included in the apk (e.g. for is_component_build).
# apk_under_test: The apk being tested.
# javac_args: Additional arguments to pass to javac.
# #
# Example # Example
# instrumentation_test_apk("foo_test_apk") { # instrumentation_test_apk("foo_test_apk") {
......
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