Index: build/config/android/rules.gni |
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni |
index 1ad8e5b330737e6a02dd6516dd3302cd33a6f530..cfcbbee649ff3af19f975be7e4b70299b191bb1c 100644 |
--- a/build/config/android/rules.gni |
+++ b/build/config/android/rules.gni |
@@ -2620,14 +2620,35 @@ if (enable_java_templates) { |
} |
} |
- _sub_target_names = [] |
+ _resource_targets = [] |
+ |
+ # Create the android_resources target for resources. |
+ if (_scanned_files.resources != []) { |
+ _res_target_name = "${target_name}__res" |
+ _resource_targets += [ ":$_res_target_name" ] |
+ android_resources(_res_target_name) { |
+ forward_variables_from(invoker, [ "deps" ]) |
+ if (!defined(deps)) { |
+ deps = [] |
+ } |
+ deps += [ ":$_unpack_target_name" ] |
+ resource_dirs = [] |
+ generated_resource_dirs = [ "${_output_path}/res" ] |
+ generated_resource_files = |
+ rebase_path(_scanned_files.resources, "", _output_path) |
+ android_manifest_dep = ":$_unpack_target_name" |
+ android_manifest = "${_output_path}/AndroidManifest.xml" |
+ v14_skip = true |
+ } |
+ } |
# Create android_java_prebuilt targets for jar files. |
+ _jar_targets = [] |
_counter = 0 |
foreach(jar, _scanned_files.jars) { |
_counter += 1 |
_current_target = "${target_name}__jar_$_counter" |
- _sub_target_names += [ ":$_current_target" ] |
+ _jar_targets += [ ":$_current_target" ] |
java_prebuilt(_current_target) { |
forward_variables_from(invoker, |
[ |
@@ -2637,7 +2658,7 @@ if (enable_java_templates) { |
if (!defined(deps)) { |
deps = [] |
} |
- deps += [ ":$_unpack_target_name" ] |
+ deps += _resource_targets + [ ":$_unpack_target_name" ] |
if (!defined(requires_android)) { |
requires_android = true |
} |
@@ -2646,28 +2667,8 @@ if (enable_java_templates) { |
} |
} |
- # Create the android_resources target for resources. |
- if (_scanned_files.resources != []) { |
- _res_target_name = "${target_name}__res" |
- _sub_target_names += [ ":$_res_target_name" ] |
- android_resources(_res_target_name) { |
- forward_variables_from(invoker, [ "deps" ]) |
- if (!defined(deps)) { |
- deps = [] |
- } |
- deps += [ ":$_unpack_target_name" ] |
- resource_dirs = [] |
- generated_resource_dirs = [ "${_output_path}/res" ] |
- generated_resource_files = |
- rebase_path(_scanned_files.resources, "", _output_path) |
- android_manifest_dep = ":$_unpack_target_name" |
- android_manifest = "${_output_path}/AndroidManifest.xml" |
- v14_skip = true |
- } |
- } |
- |
java_group(target_name) { |
- deps = _sub_target_names |
+ deps = _resource_targets + _jar_targets |
} |
} |
} |