use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method targetedAbis_abiInSomeModules.
@Test
public void targetedAbis_abiInSomeModules() throws Exception {
AppBundle appBundle = new AppBundleBuilder().addModule("base", baseModule -> baseModule.setManifest(MANIFEST).addFile("dex/classes.dex", DUMMY_CONTENT)).addModule("detail", module -> module.setManifest(MANIFEST).addFile("dex/classes.dex", DUMMY_CONTENT).addFile("lib/arm64-v8a/libbar.so", DUMMY_CONTENT).addFile("lib/x86/libbar.so", DUMMY_CONTENT).setNativeConfig(nativeLibraries(targetedNativeDirectory("lib/arm64-v8a", nativeDirectoryTargeting(AbiAlias.ARM64_V8A)), targetedNativeDirectory("lib/x86", nativeDirectoryTargeting(AbiAlias.X86))))).build();
assertThat(appBundle.getTargetedAbis()).containsExactly(toAbi(AbiAlias.X86), toAbi(AbiAlias.ARM64_V8A));
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method storeArchiveEnabled_false.
@Test
public void storeArchiveEnabled_false() throws Exception {
AppBundle appBundle = new AppBundleBuilder().setBundleConfig(BundleConfigBuilder.create().setStoreArchive(false).build()).addModule("base", builder -> builder.setManifest(MANIFEST)).build();
assertThat(appBundle.storeArchiveEnabled()).isFalse();
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method targetedAbis_abiInAllModules.
@Test
public void targetedAbis_abiInAllModules() throws Exception {
AppBundle appBundle = new AppBundleBuilder().addModule("base", baseModule -> baseModule.setManifest(MANIFEST).addFile("dex/classes.dex", DUMMY_CONTENT).addFile("lib/x86_64/libfoo.so", DUMMY_CONTENT).addFile("lib/armeabi/libfoo.so", DUMMY_CONTENT).setNativeConfig(nativeLibraries(targetedNativeDirectory("lib/x86_64", nativeDirectoryTargeting(AbiAlias.X86_64)), targetedNativeDirectory("lib/armeabi", nativeDirectoryTargeting(AbiAlias.ARMEABI))))).addModule("detail", module -> module.setManifest(MANIFEST).addFile("dex/classes.dex", DUMMY_CONTENT).addFile("lib/x86_64/libbar.so", DUMMY_CONTENT).addFile("lib/armeabi/libbar.so", DUMMY_CONTENT).setNativeConfig(nativeLibraries(targetedNativeDirectory("lib/x86_64", nativeDirectoryTargeting(AbiAlias.X86_64)), targetedNativeDirectory("lib/armeabi", nativeDirectoryTargeting(AbiAlias.ARMEABI))))).build();
assertThat(appBundle.getTargetedAbis()).containsExactly(toAbi(AbiAlias.ARMEABI), toAbi(AbiAlias.X86_64));
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method targetedAbis_noNativeCode.
@Test
public void targetedAbis_noNativeCode() throws Exception {
AppBundle appBundle = new AppBundleBuilder().addModule("base", baseModule -> baseModule.setManifest(MANIFEST).addFile("dex/classes.dex", DUMMY_CONTENT)).addModule("detail", module -> module.setManifest(MANIFEST).addFile("dex/classes.dex", DUMMY_CONTENT)).build();
assertThat(appBundle.getTargetedAbis()).isEmpty();
}
use of com.android.tools.build.bundletool.testing.AppBundleBuilder in project bundletool by google.
the class AppBundleTest method storeArchiveEnabled_notPresent_false.
@Test
public void storeArchiveEnabled_notPresent_false() throws Exception {
AppBundle appBundle = new AppBundleBuilder().setBundleConfig(BundleConfigBuilder.create().build()).addModule("base", builder -> builder.setManifest(MANIFEST)).build();
assertThat(appBundle.storeArchiveEnabled()).isFalse();
}
Aggregations