Skip to content

Commit

Permalink
Reland "Build: remove resource_dirs support"
Browse files Browse the repository at this point in the history
This is a reland of c961f8a

Original change's description:
> Build: remove resource_dirs support
> 
> This CL removes resource_dirs support from android_resources, it was
> deprecated in favour of sources.
> 
> Details:
> https://crbug.com/1026378
> https://groups.google.com/a/chromium.org/forum/#!msg/chromium-dev/KAFsfaoq7y4/OC4v5sb9BQAJ
> 
> Bug: 1062263
> Change-Id: I5063b0b5c6d45a5e860901e27a66d6a503a1fbf4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2136036
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#756711}

Bug: 1062263
Change-Id: Ie547290a0390e050c8c3ed1ee55d323a2704fa7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2139948
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757432}
  • Loading branch information
vasilyt authored and Commit Bot committed Apr 8, 2020
1 parent 9b64cb5 commit eaa5bd8
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions build/config/android/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -875,12 +875,12 @@ if (enable_java_templates) {
# own dependencies.
#
# Variables
# sources: List of resource files for this target.
# deps: Specifies the dependencies of this target. Any Android resources
# listed in deps will be included by libraries/apks that depend on this
# target.
# alternative_android_sdk_dep: Optional. Alternative Android system
# android java target to use.
# resource_dirs: List of directories containing resources for this target.
# android_manifest: AndroidManifest.xml for this target (optional). Will be
# merged into apks that directly or indirectly depend on this target.
# android_manifest_dep: Target that generates AndroidManifest (if applicable)
Expand Down Expand Up @@ -918,7 +918,10 @@ if (enable_java_templates) {
not_needed(invoker, [ "v14_skip" ])
}

_pass_resource_files = defined(invoker.sources)
assert(!defined(invoker.resource_dirs) || defined(invoker.sources),
"resource_dirs in android_resources is deprecated. Please use " +
"sources=[] and list resource files instead. Details: " +
"https://crbug.com/1026378")
_res_sources_path = "$target_gen_dir/${invoker.target_name}.res.sources"

_resources_zip = "$target_out_dir/$target_name.resources.zip"
Expand All @@ -941,19 +944,11 @@ if (enable_java_templates) {
_deps += [ "//third_party/android_sdk:android_sdk_java" ]
}

if (_pass_resource_files) {
_resource_files = invoker.sources
} else {
_sources_build_rel = []

if (invoker.resource_dirs != []) {
_sources_build_rel +=
exec_script("//build/android/gyp/find.py",
rebase_path(invoker.resource_dirs, root_build_dir),
"list lines")
}
_resource_files = rebase_path(_sources_build_rel, ".", root_build_dir)
_resource_files = []
if (defined(invoker.sources)) {
_resource_files += invoker.sources
}

_rebased_resource_files = rebase_path(_resource_files, root_build_dir)
write_file(_res_sources_path, _rebased_resource_files)

Expand Down

0 comments on commit eaa5bd8

Please sign in to comment.