use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class BundleModuleTest method moduleTargeting_noConditions_noMinSdkInherited.
@Test
public void moduleTargeting_noConditions_noMinSdkInherited() {
BundleModule bundleModule = createMinimalModuleBuilder().setAndroidManifestProto(androidManifest("com.test.app", withMinSdkVersion(24))).build();
ModuleTargeting moduleTargeting = bundleModule.getModuleMetadata().getTargeting();
assertThat(moduleTargeting).isEqualToDefaultInstance();
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class BundleModuleTest method moduleTargeting_noModuleMinSdkVersion_noConditionsAddded.
@Test
public void moduleTargeting_noModuleMinSdkVersion_noConditionsAddded() {
BundleModule bundleModule = createMinimalModuleBuilder().setAndroidManifestProto(androidManifest("com.test.app", withFeatureCondition("com.feature1"))).build();
ModuleTargeting moduleTargeting = bundleModule.getModuleMetadata().getTargeting();
assertThat(moduleTargeting).ignoringRepeatedFieldOrder().isEqualTo(moduleFeatureTargeting("com.feature1"));
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleConditionsTest method toTargeting_minMaxSdkVersions.
@Test
public void toTargeting_minMaxSdkVersions() {
ModuleConditions moduleConditions = ModuleConditions.builder().setMinSdkVersion(26).setMaxSdkVersion(28).build();
ModuleTargeting moduleTargeting = moduleConditions.toTargeting();
assertThat(moduleTargeting).isEqualTo(moduleMinMaxSdkVersionTargeting(26, 28));
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleConditionsTest method toTargeting_userCountriesCondition.
@Test
public void toTargeting_userCountriesCondition() {
ModuleConditions moduleConditions = ModuleConditions.builder().setUserCountriesCondition(UserCountriesCondition.create(ImmutableList.of("PL", "US"), /* exclude= */
false)).build();
ModuleTargeting moduleTargeting = moduleConditions.toTargeting();
assertThat(moduleTargeting).ignoringRepeatedFieldOrder().isEqualTo(mergeModuleTargeting(moduleIncludeCountriesTargeting("PL", "US")));
}
use of com.android.bundle.Targeting.ModuleTargeting in project bundletool by google.
the class ModuleConditionsTest method toTargeting_maxSdkVersion.
@Test
public void toTargeting_maxSdkVersion() {
ModuleConditions moduleConditions = ModuleConditions.builder().setMaxSdkVersion(26).build();
ModuleTargeting moduleTargeting = moduleConditions.toTargeting();
assertThat(moduleTargeting).isEqualTo(moduleMaxSdkVersionTargeting(26));
}
Aggregations