aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-07-26 20:52:55 +0200
committerGravatar Jakob Buchgraber <buchgr@google.com>2017-07-27 09:05:17 +0200
commitab39f78d88bd0bfcf0664d95b06125416dd04033 (patch)
treefc93da5fbb0d5539f21434fe4f9dd2388b7f2e5c /src/tools/android/java/com
parent43bc4923e5b2219924ae95f17ffe8b9f35f32fce (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.java2
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.