use of com.android.bundle.Commands.BuildApksResult in project bundletool by google.
the class ApkMatcherTest method splitApk_conditionalModule_deviceNotEligible.
@Test
public void splitApk_conditionalModule_deviceNotEligible() {
DeviceSpec device = mergeSpecs(deviceWithSdk(21), deviceFeatures("reqGlEsVersion=0x30000"));
ZipPath baseApk = ZipPath.create("base-master.apk");
ZipPath feature1Apk = ZipPath.create("ar-master.apk");
ZipPath feature2Apk = ZipPath.create("opengl-master.apk");
ZipPath feature3Apk = ZipPath.create("high_end-master.apk");
BuildApksResult buildApksResult = buildApksResult(createVariant(variantSdkTargeting(21), splitApkSet(/* moduleName= */
"base", splitApkDescription(ApkTargeting.getDefaultInstance(), baseApk)), createConditionalApkSet(/* moduleName= */
"ar", mergeModuleTargeting(moduleFeatureTargeting("android.hardware.camera.ar"), moduleMinSdkVersionTargeting(24)), splitApkDescription(ApkTargeting.getDefaultInstance(), feature1Apk)), createConditionalApkSet(/* moduleName= */
"opengl", mergeModuleTargeting(moduleFeatureTargeting("android.hardware.opengles.version", 0x30001), moduleMinSdkVersionTargeting(21)), splitApkDescription(ApkTargeting.getDefaultInstance(), feature2Apk)), createConditionalApkSet(/* moduleName= */
"high_end", mergeModuleTargeting(moduleDeviceGroupsTargeting("highRam"), moduleMinSdkVersionTargeting(21)), splitApkDescription(ApkTargeting.getDefaultInstance(), feature3Apk))));
assertThat(new ApkMatcher(device).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(baseApk));
}
use of com.android.bundle.Commands.BuildApksResult in project bundletool by google.
the class ApkMatcherTest method apkDoesntMatch_abiSplit_betterAlternative.
@Test
public void apkDoesntMatch_abiSplit_betterAlternative() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), apkAbiTargeting(ARM64_V8A, ImmutableSet.of(X86_64)), apk));
assertThat(new ApkMatcher(lDeviceWithAbis("x86_64", "x86", "arm64-v8a")).getMatchingApks(buildApksResult)).isEmpty();
}
use of com.android.bundle.Commands.BuildApksResult in project bundletool by google.
the class ApkMatcherTest method apkNoMatch_screenDensitySplit_betterAlternative.
@Test
public void apkNoMatch_screenDensitySplit_betterAlternative() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), apkDensityTargeting(HDPI, ImmutableSet.of(XXXHDPI)), apk));
assertThat(new ApkMatcher(lDeviceWithDensity(XXHDPI)).getMatchingApks(buildApksResult)).isEmpty();
}
use of com.android.bundle.Commands.BuildApksResult in project bundletool by google.
the class ApkMatcherTest method apkMatch_textureSplit_betterAlternative.
@Test
public void apkMatch_textureSplit_betterAlternative() {
ZipPath apk = ZipPath.create("master-etc1_rgb8.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), apkTextureTargeting(ETC1_RGB8, ImmutableSet.of(ATC, PVRTC)), apk));
assertThat(new ApkMatcher(lDeviceWithGlExtensions("GL_OES_compressed_ETC1_RGB8_texture", "GL_IMG_texture_compression_pvrtc")).getMatchingApks(buildApksResult)).isEmpty();
}
use of com.android.bundle.Commands.BuildApksResult in project bundletool by google.
the class ApkMatcherTest method apkMatch_screenDensitySplit.
// Density splits.
@Test
public void apkMatch_screenDensitySplit() {
ZipPath apk = ZipPath.create("sample.apk");
BuildApksResult buildApksResult = buildApksResult(oneApkSplitApkVariant(variantSdkTargeting(sdkVersionFrom(Versions.ANDROID_L_API_VERSION)), apkDensityTargeting(HDPI), apk));
assertThat(new ApkMatcher(lDeviceWithDensity(HDPI)).getMatchingApks(buildApksResult)).containsExactly(baseMatchedApk(apk));
}
Aggregations