use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.
the class BundleConfigValidatorTest method compression_invalidGlob_throws.
@Test
public void compression_invalidGlob_throws() throws Exception {
AppBundle appBundle = createAppBundle(BundleConfigBuilder.create().clearCompression().addUncompressedGlob("res/raw\\"));
InvalidBundleException e = assertThrows(InvalidBundleException.class, () -> new BundleConfigValidator().validateBundle(appBundle));
assertThat(e).hasMessageThat().contains("Invalid uncompressed glob: 'res/raw\\'.");
}
use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.
the class BundleConfigValidatorTest method optimizations_uniqueSplitDimensions_ok.
@Test
public void optimizations_uniqueSplitDimensions_ok() throws Exception {
AppBundle appBundle = createAppBundle(BundleConfigBuilder.create().clearOptimizations().addSplitDimension(SplitDimension.Value.ABI).addSplitDimension(SplitDimension.Value.SCREEN_DENSITY));
new BundleConfigValidator().validateBundle(appBundle);
}
use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.
the class BundleConfigValidatorTest method optimizations_tcfDimensionSuffixStrippingWithoutDefault_ok.
@Test
public void optimizations_tcfDimensionSuffixStrippingWithoutDefault_ok() throws Exception {
AppBundle appBundle = createAppBundle(BundleConfigBuilder.create().clearOptimizations().addSplitDimension(SplitDimension.newBuilder().setValueValue(Value.TEXTURE_COMPRESSION_FORMAT_VALUE).setSuffixStripping(SuffixStripping.newBuilder().setEnabled(true)).build()));
new BundleConfigValidator().validateBundle(appBundle);
}
use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.
the class BundleConfigValidatorTest method version_missing_ok.
@Test
public void version_missing_ok() throws Exception {
AppBundle appBundle = createAppBundle(BundleConfigBuilder.create().clearVersion());
new BundleConfigValidator().validateBundle(appBundle);
}
use of com.android.tools.build.bundletool.model.AppBundle in project bundletool by google.
the class BundleConfigValidatorTest method masterResources_undefinedResourceId_throws.
@Test
public void masterResources_undefinedResourceId_throws() throws Exception {
ResourceTable resourceTable = new ResourceTableBuilder().addPackage("com.test.app").addStringResource("label", "Hello World").build();
int nonExistentResourceId = ResourcesUtils.entries(resourceTable).findFirst().get().getResourceId().getFullResourceId() + 1;
AppBundle appBundle = createAppBundleBuilder(BundleConfigBuilder.create().addResourcePinnedToMasterSplit(nonExistentResourceId)).addModule("feature", module -> module.setResourceTable(resourceTable).setManifest(androidManifest("com.test.app"))).build();
InvalidBundleException e = assertThrows(InvalidBundleException.class, () -> new BundleConfigValidator().validateBundle(appBundle));
assertThat(e).hasMessageThat().contains("The Master Resources list contains resource IDs not defined in any module. " + "For example: 0x7f010001");
}
Aggregations