use of com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.INSTANT in project bundletool by google.
the class BuildApksManagerTest method buildApksCommand_instantMode.
@Test
public void buildApksCommand_instantMode() throws Exception {
AppBundle appBundle = new AppBundleBuilder().addModule("base", builder -> builder.setManifest(androidManifest("com.app", withInstant(true)))).build();
TestComponent.useTestModule(this, createTestModuleBuilder().withAppBundle(appBundle).withOutputPath(outputFilePath).withApkBuildMode(INSTANT).build());
buildApksManager.execute();
ZipFile apkSetFile = openZipFile(outputFilePath.toFile());
BuildApksResult result = extractTocFromApkSetFile(apkSetFile, outputDir);
assertThat(splitApkVariants(result)).isEmpty();
assertThat(standaloneApkVariants(result)).isEmpty();
assertThat(systemApkVariants(result)).isEmpty();
assertThat(instantApkVariants(result)).isNotEmpty();
}
use of com.android.tools.build.bundletool.commands.BuildApksCommand.ApkBuildMode.INSTANT in project bundletool by google.
the class BuildApksManagerTest method buildApksCommand_instantModeWithAssetModules.
@Test
public void buildApksCommand_instantModeWithAssetModules() throws Exception {
AppBundle appBundle = new AppBundleBuilder().addModule("base", builder -> builder.setManifest(androidManifest("com.app", withInstant(true)))).addModule("asset_module", builder -> builder.setManifest(androidManifestForAssetModule("com.app", withInstantOnDemandDelivery()))).build();
TestComponent.useTestModule(this, createTestModuleBuilder().withAppBundle(appBundle).withOutputPath(outputFilePath).withApkBuildMode(INSTANT).build());
buildApksManager.execute();
ZipFile apkSetFile = openZipFile(outputFilePath.toFile());
BuildApksResult result = extractTocFromApkSetFile(apkSetFile, outputDir);
assertThat(result.getAssetSliceSetList()).isNotEmpty();
}
Aggregations