use of com.android.tools.build.bundletool.testing.BundleConfigBuilder in project bundletool by google.
the class BuildBundleCommandTest method bundleConfig_saved.
@Test
public void bundleConfig_saved() throws Exception {
Path module = createSimpleBaseModule();
// Any version supplied by the user is ignored and overwritten.
BundleConfig bundleConfigFromUser = BundleConfigBuilder.create().setVersion("0.0.0").build();
BundleConfig bundleConfigInBundle = new BundleConfigBuilder(bundleConfigFromUser).setVersion(BundleToolVersion.getCurrentVersion().toString()).build();
assertThat(bundleConfigFromUser.getBundletool().getVersion()).isNotEqualTo(bundleConfigInBundle.getBundletool().getVersion());
BuildBundleCommand.builder().setModulesPaths(ImmutableList.of(module)).setOutputPath(bundlePath).setBundleConfig(bundleConfigFromUser).build().execute();
try (ZipFile appBundleZip = new ZipFile(bundlePath.toFile())) {
AppBundle appBundle = AppBundle.buildFromZip(appBundleZip);
assertThat(appBundle.getBundleConfig()).isEqualTo(bundleConfigInBundle);
}
}
Aggregations