use of com.android.tools.build.bundletool.testing.BundleModuleBuilder in project bundletool by google.
the class AbiParityValidatorTest method differentAbis_throws.
@Test
public void differentAbis_throws() throws Exception {
BundleModule moduleA = new BundleModuleBuilder("a").addFile("lib/x86/lib1.so").addFile("lib/mips/lib2.so").setManifest(androidManifest("com.test.app")).build();
BundleModule moduleB = new BundleModuleBuilder("b").addFile("lib/x86/lib3.so").addFile("lib/x86_64/lib4.so").setManifest(androidManifest("com.test.app")).build();
InvalidBundleException exception = assertThrows(InvalidBundleException.class, () -> new AbiParityValidator().validateAllModules(ImmutableList.of(moduleA, moduleB)));
assertThat(exception).hasMessageThat().contains("must support the same set of ABIs");
}
use of com.android.tools.build.bundletool.testing.BundleModuleBuilder in project bundletool by google.
the class AbiParityValidatorTest method sameAbis_ok.
@Test
public void sameAbis_ok() throws Exception {
BundleModule moduleA = new BundleModuleBuilder("a").addFile("lib/x86/lib1.so").addFile("lib/mips/lib2.so").setManifest(androidManifest("com.test.app")).build();
BundleModule moduleB = new BundleModuleBuilder("b").addFile("lib/x86/lib3.so").addFile("lib/mips/lib4.so").setManifest(androidManifest("com.test.app")).build();
new AbiParityValidator().validateAllModules(ImmutableList.of(moduleA, moduleB));
}
use of com.android.tools.build.bundletool.testing.BundleModuleBuilder in project bundletool by google.
the class AbiParityValidatorTest method sameAbisAndNoAbi_ok.
@Test
public void sameAbisAndNoAbi_ok() throws Exception {
BundleModule moduleA = new BundleModuleBuilder("a").addFile("lib/x86/lib1.so").addFile("lib/mips/lib2.so").setManifest(androidManifest("com.test.app")).build();
BundleModule moduleB = new BundleModuleBuilder("b").addFile("lib/x86/lib3.so").addFile("lib/mips/lib4.so").setManifest(androidManifest("com.test.app")).build();
BundleModule moduleC = new BundleModuleBuilder("c").setManifest(androidManifest("com.test.app")).build();
new AbiParityValidator().validateAllModules(ImmutableList.of(moduleA, moduleB, moduleC));
}
use of com.android.tools.build.bundletool.testing.BundleModuleBuilder in project bundletool by google.
the class AndroidManifestValidatorTest method withMultipleEqualSplitIds.
@Test
public void withMultipleEqualSplitIds() throws Exception {
BundleModule module = new BundleModuleBuilder(FEATURE_MODULE_NAME).setManifest(androidManifestForFeature(PKG_NAME, withSplitId(FEATURE_MODULE_NAME), withSecondSplitId(FEATURE_MODULE_NAME))).build();
// We accept multiple identical split IDs, so this should not throw.
new AndroidManifestValidator().validateModule(module);
}
use of com.android.tools.build.bundletool.testing.BundleModuleBuilder in project bundletool by google.
the class AndroidManifestValidatorTest method withMinSdkUndeclared_ok.
@Test
public void withMinSdkUndeclared_ok() throws Exception {
BundleModule base = baseModule(withMinSdkVersion(20));
BundleModule module = new BundleModuleBuilder(FEATURE_MODULE_NAME).setManifest(androidManifest(PKG_NAME)).build();
new AndroidManifestValidator().validateAllModules(ImmutableList.of(base, module));
// No exception thrown.
}
Aggregations