diff options
author | Googler <noreply@google.com> | 2017-07-26 20:52:55 +0200 |
---|---|---|
committer | Jakob Buchgraber <buchgr@google.com> | 2017-07-27 09:05:17 +0200 |
commit | ab39f78d88bd0bfcf0664d95b06125416dd04033 (patch) | |
tree | fc93da5fbb0d5539f21434fe4f9dd2388b7f2e5c /src/tools/android/java/com | |
parent | 43bc4923e5b2219924ae95f17ffe8b9f35f32fce (diff) |
Resource filtering should preserve all matching artifacts, despite shared names
Before this change, density-based resource filtering tracked resources by
qualifiers and name. Resources with density qualifiers specified would go into
this code, but only one resource would be chosen from each each (qualifier,
name) pair.
Instead, track the resource using its entire path, this tracking resources with
the same name seperately.
Also, in case multiple resource are passed to the resource processing action,
resource filtering only ignores a file if its name was in the list of resources
to ignore *and* it does not exist. Otherwise, legitimate resources with the
same name as a filtered resource might be ignored.
RELNOTES: none
PiperOrigin-RevId: 163235681
Diffstat (limited to 'src/tools/android/java/com')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/AndroidDataDeserializer.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidDataDeserializer.java b/src/tools/android/java/com/google/devtools/build/android/AndroidDataDeserializer.java index 94a35dd175..f48a7966c6 100644 --- a/src/tools/android/java/com/google/devtools/build/android/AndroidDataDeserializer.java +++ b/src/tools/android/java/com/google/devtools/build/android/AndroidDataDeserializer.java @@ -153,7 +153,7 @@ public class AndroidDataDeserializer { // Using Path.subpath would return a backslash-using path on Windows. String shortPath = source.getPath().getParent().getFileName() + "/" + source.getPath().getFileName(); - if (filteredResources.contains(shortPath)) { + if (filteredResources.contains(shortPath) && !Files.exists(source.getPath())) { // Skip files that were filtered out during analysis. // TODO(asteinb): Properly filter out these files from android_library symbol files during // analysis instead, and remove this list. |