use of com.android.tools.build.bundletool.model.BundleModule in project bundletool by google.
the class AndroidManifestValidatorTest method installTimeDeliveryAndInstantAttributeSetToTrue_ok.
@Test
public void installTimeDeliveryAndInstantAttributeSetToTrue_ok() throws Exception {
BundleModule module = new BundleModuleBuilder(FEATURE_MODULE_NAME).setManifest(androidManifest(PKG_NAME, withInstallTimeDelivery(), withInstant(true), withFusingAttribute(true))).build();
new AndroidManifestValidator().validateModule(module);
}
use of com.android.tools.build.bundletool.model.BundleModule in project bundletool by google.
the class AndroidManifestValidatorTest method instantAssetModuleWithInstallTimeInstantDelivery_throws.
@Test
public void instantAssetModuleWithInstallTimeInstantDelivery_throws() throws Exception {
BundleModule module = new BundleModuleBuilder("assetmodule").setManifest(androidManifestForAssetModule(PKG_NAME, withOnDemandDelivery(), withInstantInstallTimeDelivery())).build();
InvalidBundleException exception = assertThrows(InvalidBundleException.class, () -> new AndroidManifestValidator().validateModule(module));
assertThat(exception).hasMessageThat().startsWith("Instant delivery cannot be install-time (module 'assetmodule').");
}
use of com.android.tools.build.bundletool.model.BundleModule in project bundletool by google.
the class AndroidManifestValidatorTest method base_withoutFusingConfig_ok.
@Test
public void base_withoutFusingConfig_ok() throws Exception {
BundleModule module = baseModule();
new AndroidManifestValidator().validateModule(module);
}
use of com.android.tools.build.bundletool.model.BundleModule in project bundletool by google.
the class AndroidManifestValidatorTest method assetModule_withVersionCode_throws.
@Test
public void assetModule_withVersionCode_throws() throws Exception {
ImmutableList<BundleModule> bundleModules = ImmutableList.of(new BundleModuleBuilder(BASE_MODULE_NAME).setManifest(androidManifest("com.test", withVersionCode(2))).build(), new BundleModuleBuilder("asset_module").setManifest(androidManifestForAssetModule("com.test.app", withVersionCode(42))).build());
Throwable exception = assertThrows(InvalidBundleException.class, () -> new AndroidManifestValidator().validateAllModules(bundleModules));
assertThat(exception).hasMessageThat().matches("Asset packs cannot specify a version code, but 'asset_module' does.");
}
use of com.android.tools.build.bundletool.model.BundleModule in project bundletool by google.
the class AndroidManifestValidatorTest method bundleModules_differentTargetSandboxVersionCode_throws.
@Test
public void bundleModules_differentTargetSandboxVersionCode_throws() throws Exception {
ImmutableList<BundleModule> bundleModules = ImmutableList.of(new BundleModuleBuilder(BASE_MODULE_NAME).setManifest(androidManifest("com.test", withTargetSandboxVersion(1))).build(), new BundleModuleBuilder(FEATURE_MODULE_NAME).setManifest(androidManifest("com.test", withTargetSandboxVersion(2))).build());
InvalidBundleException exception = assertThrows(InvalidBundleException.class, () -> new AndroidManifestValidator().validateAllModules(bundleModules));
assertThat(exception).hasMessageThat().contains("should have the same value across modules, but found [1,2]");
}
Aggregations