diff options
author | 2017-07-26 20:52:55 +0200 | |
---|---|---|
committer | 2017-07-27 09:05:17 +0200 | |
commit | ab39f78d88bd0bfcf0664d95b06125416dd04033 (patch) | |
tree | fc93da5fbb0d5539f21434fe4f9dd2388b7f2e5c /src/test/java | |
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/test/java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/android/ResourceFilterTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/android/ResourceFilterTest.java b/src/test/java/com/google/devtools/build/lib/rules/android/ResourceFilterTest.java index 65f6d2e30d..e2d7b9f6f2 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/android/ResourceFilterTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/android/ResourceFilterTest.java @@ -350,6 +350,17 @@ public class ResourceFilterTest extends ResourceTestBase { } @Test + public void testFilterResourceConflict() throws Exception { + testNoopFilter( + "en", + "hdpi", + FilterBehavior.FILTER_IN_ANALYSIS, + ImmutableList.of( + "first-subdir/res/drawable-en-hdpi/foo.png", + "second-subdir/res/drawable-en-hdpi/foo.png")); + } + + @Test public void testFilterWithDynamicConfiguration() throws Exception { testFilter( "en", |