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

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

Issue 2095913003: 🎊 Have build_config targets depend only on other build_config targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromecast Created 4 years, 6 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
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | chromecast/browser/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/rules.gni
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index 4cb5b4d6bce6cdba26e10600cd815ca603f9fd11..841b6e61b6d066f269d0e0a2f2d20ce8afa3b464 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -710,6 +710,7 @@ if (enable_java_templates) {
# is specified.
# android_manifest: AndroidManifest.xml for this target. Defaults to
# //build/android/AndroidManifest.xml.
+ # android_manifest_dep: Target that generates AndroidManifest (if applicable)
# custom_package: java package for generated .java files.
# v14_skip: If true, don't run v14 resource generator on this. Defaults to
# false. (see build/android/gyp/generate_v14_compatible_resources.py)
@@ -746,14 +747,23 @@ if (enable_java_templates) {
final_target_name = target_name
write_build_config(build_config_target_name) {
+ type = "android_resources"
forward_variables_from(invoker,
[
"android_manifest",
"custom_package",
- "deps",
"resource_dirs",
])
+ if (defined(invoker.deps)) {
+ possible_config_deps = invoker.deps
+ }
+ if (defined(invoker.android_manifest_dep)) {
+ deps = [
+ invoker.android_manifest_dep,
+ ]
+ }
+
# No package means resources override their deps.
if (defined(custom_package) || defined(android_manifest)) {
r_text = r_text_path
@@ -761,15 +771,12 @@ if (enable_java_templates) {
assert(defined(invoker.deps),
"Must specify deps when custom_package is omitted.")
}
- visibility = [ ":$process_resources_target_name" ]
- type = "android_resources"
resources_zip = zip_path
srcjar = srcjar_path
}
process_resources(process_resources_target_name) {
- visibility = [ ":$final_target_name" ]
forward_variables_from(invoker,
[
"app_as_shared_lib",
@@ -786,6 +793,9 @@ if (enable_java_templates) {
deps = []
}
deps += [ ":$build_config_target_name" ]
+ if (defined(invoker.android_manifest_dep)) {
+ deps += [ invoker.android_manifest_dep ]
+ }
# Always generate R.onResourcesLoaded() method, it is required for
# compiling ResourceRewriter, there is no side effect because the
@@ -849,13 +859,15 @@ if (enable_java_templates) {
_build_config_target_name = "${target_name}__build_config"
write_build_config(_build_config_target_name) {
- forward_variables_from(invoker,
- [
- "deps",
- "disable_compression",
- ])
type = "android_assets"
build_config = _build_config
+
+ forward_variables_from(invoker, [ "disable_compression" ])
+
+ if (defined(invoker.deps)) {
+ possible_config_deps = invoker.deps
+ }
+
if (defined(invoker.sources)) {
asset_sources = invoker.sources
}
@@ -895,13 +907,18 @@ if (enable_java_templates) {
# }
template("java_group") {
write_build_config("${target_name}__build_config") {
- forward_variables_from(invoker, [ "deps" ])
type = "group"
build_config = "$target_gen_dir/${invoker.target_name}.build_config"
+
+ if (defined(invoker.deps)) {
+ possible_config_deps = invoker.deps
+ }
}
group(target_name) {
- deps = []
forward_variables_from(invoker, "*")
+ if (!defined(deps)) {
+ deps = []
+ }
deps += [ ":${target_name}__build_config" ]
}
}
@@ -929,7 +946,6 @@ if (enable_java_templates) {
build_config = base_path + ".build_config"
write_build_config("${target_name}__build_config") {
- forward_variables_from(invoker, [ "deps" ])
type = "android_resources"
}
@@ -939,6 +955,7 @@ if (enable_java_templates) {
grit_target_name = "${target_name}__grit"
grit_output_dir = "$target_gen_dir/$extra_output_path"
grit(grit_target_name) {
+ forward_variables_from(invoker, [ "deps" ])
grit_flags = [
"-E",
"ANDROID_JAVA_TAGGED_ONLY=false",
@@ -999,7 +1016,6 @@ if (enable_java_templates) {
final_target_name = target_name
write_build_config(build_config_target_name) {
- visibility = [ ":$zip_target_name" ]
type = "android_resources"
}
@@ -1610,18 +1626,19 @@ if (enable_java_templates) {
android_manifest = _android_manifest
deps = _android_manifest_deps
+
if (defined(invoker.deps)) {
- deps += invoker.deps
+ possible_config_deps = invoker.deps
}
if (defined(invoker.alternative_locale_resource_dep)) {
- deps += [ invoker.alternative_locale_resource_dep ]
+ possible_config_deps += [ invoker.alternative_locale_resource_dep ]
has_alternative_locale_resource = true
}
# Added emma to the target's classpath via its .build_config.
if (emma_coverage && !_emma_never_instrument) {
- deps += [ "//third_party/android_tools:emma_device" ]
+ possible_config_deps += [ "//third_party/android_tools:emma_device" ]
}
proguard_enabled = _proguard_enabled
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | chromecast/browser/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698