Commit 91b8e92d authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

Android: Add res_sources_path to build config deps

Java targets use the contents of the res_sources_path file of all their
dependencies to determine the resource_dirs value in the java target's
build config. Thus these files need to be in its depfile through
all_inputs.

Also remove unused resource directory shortcut, and build/android/empty*

Bug: 1049296
Change-Id: Icc8375bdeca1a4ba2d954a964a62bf852a81b788
Fixed: 1049296
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2042405
Auto-Submit: Peter Wen <wnwen@chromium.org>
Reviewed-by: default avatarMohamed Heikal <mheikal@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739042}
parent 38388e8e
# This empty res folder can be passed to aapt while building Java libraries or
# APKs that don't have any resources.
# Used for apk targets that do not need proguard. See build/java_apk.gypi.
......@@ -1271,6 +1271,7 @@ def main(argv):
resource_dirs = resource_utils.ExtractResourceDirsFromFileList(
resource_files)
owned_resource_dirs.update(resource_dirs)
all_inputs.append(c['res_sources_path'])
else:
owned_resource_zips.add(c['resources_zip'])
srcjar = c.get('srcjar')
......
......@@ -950,9 +950,7 @@ if (enable_java_templates) {
} else {
_sources_build_rel = []
# Speed up "gn gen" by short-circuiting the empty directory.
if (invoker.resource_dirs != [ "//build/android/empty" ] &&
invoker.resource_dirs != []) {
if (invoker.resource_dirs != []) {
_sources_build_rel +=
exec_script("//build/android/gyp/find.py",
rebase_path(invoker.resource_dirs, root_build_dir),
......@@ -960,7 +958,6 @@ if (enable_java_templates) {
}
_resource_files = rebase_path(_sources_build_rel, ".", root_build_dir)
}
_rebased_resource_files = rebase_path(_resource_files, root_build_dir)
write_file(_res_sources_path, _rebased_resource_files)
......
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