use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method variantBetterAlternative_preL_abiShard.
@Test
public void variantBetterAlternative_preL_abiShard() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(standaloneVariant(mergeVariantTargeting(variantSdkTargeting(sdkVersionFrom(1), ImmutableSet.of(sdkVersionFrom(21))), variantAbiTargeting(X86, ImmutableSet.of(ARMEABI_V7A, ARM64_V8A, X86_64))), ApkTargeting.getDefaultInstance(), apk));
assertThat(new ApkMatcher(deviceWith(19, ImmutableList.of("x86_64", "x86"), MDPI)).getMatchingApks(buildApksResult)).isEmpty();
}
use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method variantWorseAlternatives_preL_abiShard.
@Test
public void variantWorseAlternatives_preL_abiShard() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(standaloneVariant(mergeVariantTargeting(variantSdkTargeting(sdkVersionFrom(1), ImmutableSet.of(sdkVersionFrom(21))), variantAbiTargeting(X86, ImmutableSet.of(ARMEABI_V7A, ARM64_V8A))), ApkTargeting.getDefaultInstance(), apk));
assertThat(new ApkMatcher(deviceWith(19, ImmutableList.of("x86_64", "x86", "arm64-v8a"), MDPI)).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(apk));
}
use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method apkMatch_deviceMatchesVariantValue_noBetterAlternativeDefaultValue.
@Test
public void apkMatch_deviceMatchesVariantValue_noBetterAlternativeDefaultValue() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(21), ImmutableSet.of(sdkVersionFrom(1))), ApkTargeting.getDefaultInstance(), apk));
assertThat(new ApkMatcher(deviceWithSdk(21)).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(apk));
assertThat(new ApkMatcher(deviceWithSdk(22)).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(apk));
}
use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method apkMatch_deviceMatchesVariantValue_noAlternatives.
// SDK variant matching.
@Test
public void apkMatch_deviceMatchesVariantValue_noAlternatives() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(21)), ApkTargeting.getDefaultInstance(), apk));
assertThat(new ApkMatcher(deviceWithSdk(21)).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(apk));
}
use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method apkMatch_screenDensitySplit_noBetterAlternative_complex.
@Test
public void apkMatch_screenDensitySplit_noBetterAlternative_complex() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), apkDensityTargeting(XXHDPI, ImmutableSet.of(MDPI, HDPI, XXXHDPI)), apk));
assertThat(new ApkMatcher(lDeviceWithDensity(XXHDPI)).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(apk));
}
Aggregations