use of com.android.tools.build.bundletool.model.utils.ResourcesUtils.HDPI_VALUE in project bundletool by google.
the class ScreenDensityResourcesSplitterTest method manifestMutatorToRequireSplits_registered_whenDensityResourcesPresent.
@Test
public void manifestMutatorToRequireSplits_registered_whenDensityResourcesPresent() throws Exception {
BundleModule testModule = new BundleModuleBuilder("testModule").addFile("res/drawable-mdpi/image.jpg").addFile("res/drawable-hdpi/image.jpg").setResourceTable(new ResourceTableBuilder().addPackage("com.test.app").addDrawableResourceForMultipleDensities("image", ImmutableMap.of(MDPI_VALUE, "res/drawable-ldpi/image.jpg", HDPI_VALUE, "res/drawable-dpi/image.jpg")).build()).setManifest(androidManifest("com.test.app")).build();
ImmutableCollection<ModuleSplit> densitySplits = splitter.split(ModuleSplit.forResources(testModule));
ImmutableList<ModuleSplit> configSplits = densitySplits.stream().filter(split -> !split.isMasterSplit()).collect(toImmutableList());
assertThat(configSplits).isNotEmpty();
for (ModuleSplit configSplit : configSplits) {
assertThat(compareManifestMutators(configSplit.getMasterManifestMutators(), withSplitsRequired(true))).isTrue();
}
}
Aggregations