use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method apkNoMatch_screenDensitySplit_betterAlternative_complex.
@Test
public void apkNoMatch_screenDensitySplit_betterAlternative_complex() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), apkDensityTargeting(XXXHDPI, ImmutableSet.of(MDPI, HDPI, XXHDPI)), apk));
assertThat(new ApkMatcher(lDeviceWithDensity(XXHDPI)).getMatchingApks(buildApksResult)).isEmpty();
}
use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method apexVariantMatch_matchesRightVariant.
@Test
public void apexVariantMatch_matchesRightVariant() {
ZipPath x86Apk = ZipPath.create("standalone-x86.apk");
ZipPath x64X86Apk = ZipPath.create("standalone-x86_64.x86.apk");
ImmutableSet<ImmutableSet<AbiAlias>> x86Set = ImmutableSet.of(ImmutableSet.of(X86));
ImmutableSet<ImmutableSet<AbiAlias>> x64X86Set = ImmutableSet.of(ImmutableSet.of(X86_64, X86));
MultiAbiTargeting x86Targeting = multiAbiTargeting(x86Set, x64X86Set);
MultiAbiTargeting x64X86Targeting = multiAbiTargeting(x64X86Set, x86Set);
BuildApksResult buildApksResult = BuildApksResult.newBuilder().addVariant(multiAbiTargetingApexVariant(x86Targeting, x86Apk)).addVariant(multiAbiTargetingApexVariant(x64X86Targeting, x64X86Apk)).setBundletool(Bundletool.newBuilder().setVersion(BundleToolVersion.getCurrentVersion().toString())).build();
assertThat(new ApkMatcher(abis("x86")).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(x86Apk));
assertThat(new ApkMatcher(abis("x86_64", "x86")).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(x64X86Apk));
assertThat(new ApkMatcher(abis("x86_64", "x86", "armeabi-v7a")).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(x64X86Apk));
// Other device specs don't affect the matching variant.
assertThat(new ApkMatcher(deviceWith(26, ImmutableList.of("x86"), HDPI)).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(x86Apk));
}
use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method apkMatch_textureSplit_fallback.
@Test
public void apkMatch_textureSplit_fallback() {
ZipPath apk = ZipPath.create("master-other_tcf.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), apkTextureTargeting(ImmutableSet.of(), ImmutableSet.of(ATC, PVRTC)), apk));
assertThat(new ApkMatcher(lDevice()).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(apk));
}
use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method apkMatch_abiSplit.
// APK targeting tests.
// ABI splits.
@Test
public void apkMatch_abiSplit() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), apkAbiTargeting(X86), apk));
assertThat(new ApkMatcher(lDeviceWithAbis("x86_64", "x86")).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(apk));
}
use of com.android.tools.build.bundletool.model.ZipPath in project bundletool by google.
the class ApkMatcherTest method apkMatch_abiSplit_noBetterAlternative.
@Test
public void apkMatch_abiSplit_noBetterAlternative() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), apkAbiTargeting(X86, ImmutableSet.of(ARM64_V8A, ARMEABI)), apk));
assertThat(new ApkMatcher(lDeviceWithAbis("x86_64", "x86", "arm64-v8a")).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(apk));
}
Aggregations