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

Unified Diff: build/config/android/internal_rules.gni

Issue 1943583002: GN: forward_variables_from shouldn't clobber vars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 2c5586c802aa6b9141624f75cdcfa73c0aee9677..f94caac7c05af4af518734673d4530bb282c05f3 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -25,7 +25,6 @@ if (is_debug) {
template("android_lint") {
action(target_name) {
- deps = []
forward_variables_from(invoker,
[
"deps",
@@ -33,6 +32,9 @@ template("android_lint") {
"public_deps",
"testonly",
])
+ if (!defined(deps)) {
+ deps = []
+ }
_cache_dir = "$root_build_dir/android_lint_cache"
_result_path = "$target_gen_dir/$target_name/result.xml"
_config_path = "$target_gen_dir/$target_name/config.xml"
@@ -386,13 +388,15 @@ template("write_build_config") {
type == "android_assets" || type == "resource_rewriter" ||
type == "java_binary" || type == "group")
- deps = []
forward_variables_from(invoker,
[
"deps",
"testonly",
"visibility",
])
+ if (!defined(deps)) {
+ deps = []
+ }
script = "//build/android/gyp/write_build_config.py"
depfile = "$target_gen_dir/$target_name.d"
@@ -1346,7 +1350,6 @@ template("java_prebuilt_impl") {
if (defined(invoker.main_class)) {
_binary_script_target_name = "${_template_name}__java_binary_script"
java_binary_script(_binary_script_target_name) {
- deps = []
forward_variables_from(invoker,
[
"bootclasspath",
@@ -1354,6 +1357,9 @@ template("java_prebuilt_impl") {
"main_class",
"wrapper_script_args",
])
+ if (!defined(deps)) {
+ deps = []
+ }
build_config = _build_config
jar_path = _jar_path
script_name = _template_name
@@ -1436,9 +1442,12 @@ template("compile_java") {
_enable_errorprone = invoker.enable_errorprone
}
- _enable_incremental_javac = enable_incremental_javac
- if (defined(invoker.enable_incremental_javac)) {
- _enable_incremental_javac = invoker.enable_incremental_javac
+ if (defined(invoker.enable_incremental_javac_override)) {
+ # Use invoker-specified override.
+ _enable_incremental_javac = invoker.enable_incremental_javac_override
+ } else {
+ # Default to build arg if not overridden.
+ _enable_incremental_javac = enable_incremental_javac
}
_manifest_entries = []
@@ -1615,7 +1624,12 @@ template("java_library_impl") {
_android_manifest = invoker.android_manifest
}
assert(_android_manifest != "") # Mark as used.
- _run_findbugs = defined(invoker.run_findbugs) && invoker.run_findbugs
+
+ if (defined(invoker.run_findbugs_override)) {
+ _run_findbugs = invoker.run_findbugs_override
+ } else {
+ _run_findbugs = run_findbugs # Default to build arg if not overridden.
+ }
assert(_run_findbugs || true) # Mark as used.
# Don't enable coverage, lint, findbugs unless the target has some
@@ -1701,7 +1715,7 @@ template("java_library_impl") {
"alternative_android_sdk_ijar_dep",
"dist_jar_path",
"enable_errorprone",
- "enable_incremental_javac",
+ "enable_incremental_javac_override",
"jar_excluded_patterns",
"manifest_entries",
"proguard_config",
@@ -1788,12 +1802,14 @@ template("java_library_impl") {
}
group(target_name) {
- data_deps = []
forward_variables_from(invoker,
[
"data_deps",
"visibility",
])
+ if (!defined(data_deps)) {
+ data_deps = []
+ }
public_deps = _final_deps
if (_has_lint_target) {
data_deps += [ ":${_template_name}__analysis" ]
@@ -1952,8 +1968,6 @@ template("process_resources") {
template("copy_ex") {
set_sources_assignment_filter([])
action(target_name) {
- inputs = []
- sources = []
forward_variables_from(invoker,
[
"data",
@@ -1963,6 +1977,9 @@ template("copy_ex") {
"testonly",
"visibility",
])
+ if (!defined(sources)) {
+ sources = []
+ }
script = "//build/android/gyp/copy_ex.py"
depfile = "$target_gen_dir/$target_name.d"
@@ -2099,13 +2116,17 @@ template("test_runner_script") {
defined(invoker.incremental_install) && invoker.incremental_install
action(target_name) {
- data_deps = []
- deps = []
forward_variables_from(invoker,
[
"data_deps",
"deps",
])
+ if (!defined(deps)) {
+ deps = []
+ }
+ if (!defined(data_deps)) {
+ data_deps = []
+ }
script = "//build/android/gyp/create_test_runner_script.py"
depfile = "$target_gen_dir/$target_name.d"

Powered by Google App Engine
This is Rietveld 408576698