Index: build/config/android/rules.gni |
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni |
index d72242c1225605a2b64775a2f8ccdd7e22281348..debc80ddadd5a3a07be449ff6de2a22d3e40bb53 100644 |
--- a/build/config/android/rules.gni |
+++ b/build/config/android/rules.gni |
@@ -746,6 +746,27 @@ template("android_assets") { |
} |
} |
+# Declare a group() that supports forwarding java dependency information. |
+# |
+# Example |
+# java_group("conditional_deps") { |
+# if (enable_foo) { |
+# deps = [":foo_java"] |
+# } |
+# } |
+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" |
+ } |
+ group(target_name) { |
+ deps = [] |
+ forward_variables_from(invoker, "*") |
+ deps += [ ":${target_name}__build_config" ] |
+ } |
+} |
+ |
# Declare a target that generates localized strings.xml from a .grd file. |
# |
# If this target is included in the deps of an android resources/library/apk, |