use of com.android.bundle.Commands.SdkVersionInformation in project bundletool by google.
the class BuildSdkApksManagerTest method sdkVersionInformationIsSet.
@Test
public void sdkVersionInformationIsSet() throws Exception {
SdkBundle sdkBundle = new SdkBundleBuilder().setModule(new BundleModuleBuilder("base").setManifest(androidManifest(PACKAGE_NAME, withSdkLibraryElement("100"), withMetadataValue(SDK_PATCH_VERSION_ATTRIBUTE_NAME, "132"))).build()).setVersionCode(99).build();
execute(sdkBundle);
ZipFile apkSetFile = new ZipFile(outputFilePath.toFile());
BuildSdkApksResult result = extractTocFromSdkApkSetFile(apkSetFile, tmpDir);
SdkVersionInformation version = result.getVersion();
assertThat(version.getVersionCode()).isEqualTo(99);
assertThat(version.getMajor()).isEqualTo(100);
assertThat(version.getPatch()).isEqualTo(132);
}
use of com.android.bundle.Commands.SdkVersionInformation in project bundletool by google.
the class BuildSdkApksManagerTest method sdkPatchVersionIsSetToDefaultValue.
@Test
public void sdkPatchVersionIsSetToDefaultValue() throws Exception {
SdkBundle sdkBundle = new SdkBundleBuilder().setModule(new BundleModuleBuilder("base").setManifest(androidManifest(PACKAGE_NAME, withSdkLibraryElement("1181894"))).build()).build();
execute(sdkBundle);
ZipFile apkSetFile = new ZipFile(outputFilePath.toFile());
BuildSdkApksResult result = extractTocFromSdkApkSetFile(apkSetFile, tmpDir);
SdkVersionInformation version = result.getVersion();
assertThat(version.getPatch()).isEqualTo(Long.parseLong(DEFAULT_SDK_PATCH_VERSION));
}
Aggregations