use of com.android.bundle.Commands.Variant in project bundletool by google.
the class ResultUtilsTest method isArchivedApkVariantTrue.
@Test
public void isArchivedApkVariantTrue() throws Exception {
Variant variant = createArchivedVariant();
assertThat(ResultUtils.isArchivedApkVariant(variant)).isTrue();
assertThat(ResultUtils.isSplitApkVariant(variant)).isFalse();
assertThat(ResultUtils.isStandaloneApkVariant(variant)).isFalse();
assertThat(ResultUtils.isInstantApkVariant(variant)).isFalse();
assertThat(ResultUtils.isSystemApkVariant(variant)).isFalse();
}
use of com.android.bundle.Commands.Variant in project bundletool by google.
the class ResultUtilsTest method isSystemApkVariantTrue.
@Test
public void isSystemApkVariantTrue() throws Exception {
Variant variant = createSystemVariant();
assertThat(ResultUtils.isSplitApkVariant(variant)).isFalse();
assertThat(ResultUtils.isStandaloneApkVariant(variant)).isFalse();
assertThat(ResultUtils.isInstantApkVariant(variant)).isFalse();
assertThat(ResultUtils.isSystemApkVariant(variant)).isTrue();
assertThat(ResultUtils.isArchivedApkVariant(variant)).isFalse();
}
use of com.android.bundle.Commands.Variant in project bundletool by google.
the class ResultUtilsTest method filterArchivedApkVariant.
@Test
public void filterArchivedApkVariant() throws Exception {
Variant archivedVariant = createArchivedVariant();
BuildApksResult apksResult = BuildApksResult.newBuilder().addVariant(archivedVariant).build();
assertThat(ResultUtils.archivedApkVariants(apksResult)).containsExactly(archivedVariant);
}
use of com.android.bundle.Commands.Variant in project bundletool by google.
the class ResultUtilsTest method filterSplitApkVariant.
@Test
public void filterSplitApkVariant() throws Exception {
Variant standaloneVariant = createStandaloneVariant();
Variant splitVariant = createSplitVariant();
Variant instantVariant = createInstantVariant();
BuildApksResult apksResult = BuildApksResult.newBuilder().addVariant(standaloneVariant).addVariant(splitVariant).addVariant(instantVariant).build();
assertThat(ResultUtils.splitApkVariants(apksResult)).containsExactly(splitVariant);
}
use of com.android.bundle.Commands.Variant in project bundletool by google.
the class ApkSizeUtilsTest method oneLVariant.
@Test
public void oneLVariant() throws Exception {
ZipPath apkOne = ZipPath.create("apk_one.apk");
ImmutableList<Variant> variants = ImmutableList.of(createVariantForSingleSplitApk(variantSdkTargeting(sdkVersionFrom(21)), ApkTargeting.getDefaultInstance(), apkOne));
Path apksArchiveFile = createApksArchiveFile(BuildApksResult.newBuilder().addAllVariant(variants).build(), tmpDir.resolve("bundle.apks"));
ImmutableMap<String, Long> sizeByApkPaths = getVariantCompressedSizeByApkPaths(variants, apksArchiveFile);
assertThat(sizeByApkPaths.keySet()).containsExactly("apk_one.apk");
assertThat(sizeByApkPaths.get("apk_one.apk")).isAtLeast(1L);
}
Aggregations