aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-08-29 22:15:32 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-08-30 13:48:16 +0200
commit32b85516fc3ad554ec3a54d3e9cf0ee66b81127c (patch)
treea4c0a56c6c3d4e6cc52529bf9a5e9b77ac83ec4a /src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
parent2f9e7460914672cfde46ed93059802190ae1a159 (diff)
Save density information to manifests when filtering resources in analysis
Previously, when filtering in analysis, density information was not passed to execution to avoid wasting time on re-filtering. However, that density information was also used to add information to the manifest. Add an additional flag to save density information to the manifest without triggering resource filtering in execution, and use it when filtering in analysis. RELNOTES: None PiperOrigin-RevId: 166891827
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
index 2c67d4faea..b42be3be4d 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
@@ -1261,7 +1261,7 @@ public class AndroidBinaryTest extends AndroidBuildViewTestCase {
@Test
public void testDensityFilteredResourcesMultipleDensities() throws Exception {
testDensityResourceFiltering(
- "ldpi,hdpi', 'xhdpi",
+ "hdpi,ldpi,xhdpi",
ImmutableList.of("mdpi", "xxhdpi"),
ImmutableList.of("ldpi", "hdpi", "xhdpi"));
}
@@ -1335,7 +1335,7 @@ public class AndroidBinaryTest extends AndroidBuildViewTestCase {
public void testQualifierAndDensityFilteredResources() throws Exception {
testDirectResourceFiltering(
"en,fr-mdpi",
- "ldpi,hdpi",
+ "hdpi,ldpi",
ImmutableList.of("mdpi", "es-ldpi", "en-xxxhdpi", "fr-mdpi"),
ImmutableList.of("ldpi", "hdpi", "en-xhdpi", "fr-hdpi"),
/* expectUnqualifiedResource= */ false,
@@ -1446,9 +1446,16 @@ public class AndroidBinaryTest extends AndroidBuildViewTestCase {
}
// Validate resource filters are not passed to execution, since they were applied in analysis
- assertThat(resourceArguments(directResources))
+ List<String> args = resourceArguments(directResources);
+ assertThat(args)
.doesNotContain(ResourceFilter.RESOURCE_CONFIGURATION_FILTERS_NAME);
- assertThat(resourceArguments(directResources)).doesNotContain(ResourceFilter.DENSITIES_NAME);
+ assertThat(args).doesNotContain(ResourceFilter.DENSITIES_NAME);
+ if (densities.isEmpty()) {
+ assertThat(args).doesNotContain("--densitiesForManifest");
+ } else {
+ // We still expect densities only for the purposes of adding information to manifests
+ assertThat(args).containsAllOf("--densitiesForManifest", densities);
+ }
}
@Test