Search in sources :

Example 1 with VariantTargeting

use of com.android.bundle.Targeting.VariantTargeting in project bundletool by google.

the class TargetingUtilsTest method variantMultiAbiTargeting_byAbiAliasAndAlternativesSet.

@Test
public void variantMultiAbiTargeting_byAbiAliasAndAlternativesSet() {
    VariantTargeting expectedTargeting = VariantTargeting.newBuilder().setMultiAbiTargeting(SINGLE_ABI_WITH_ALTERNATIVES).build();
    assertThat(TargetingUtils.variantMultiAbiTargeting(X86, ImmutableSet.of(ARMEABI_V7A, ARM64_V8A))).isEqualTo(expectedTargeting);
}
Also used : VariantTargeting(com.android.bundle.Targeting.VariantTargeting) Test(org.junit.Test)

Example 2 with VariantTargeting

use of com.android.bundle.Targeting.VariantTargeting in project bundletool by google.

the class TargetingUtilsTest method variantMultiAbiTargetingFromAllTergeting.

@Test
public void variantMultiAbiTargetingFromAllTergeting() {
    ImmutableSet<ImmutableSet<AbiAlias>> allTargeting = ImmutableSet.of(ImmutableSet.of(ARMEABI_V7A), ImmutableSet.of(ARM64_V8A), ImmutableSet.of(X86));
    VariantTargeting expectedTargeting = VariantTargeting.newBuilder().setMultiAbiTargeting(SINGLE_ABI_WITH_ALTERNATIVES).build();
    assertThat(TargetingUtils.variantMultiAbiTargetingFromAllTargeting(ImmutableSet.of(X86), allTargeting)).ignoringRepeatedFieldOrder().isEqualTo(expectedTargeting);
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) VariantTargeting(com.android.bundle.Targeting.VariantTargeting) Test(org.junit.Test)

Example 3 with VariantTargeting

use of com.android.bundle.Targeting.VariantTargeting in project bundletool by google.

the class TargetingUtilsTest method variantMultiAbiTargeting_byMultipleAbisAndAlternatives.

@Test
public void variantMultiAbiTargeting_byMultipleAbisAndAlternatives() {
    VariantTargeting expectedTargeting = VariantTargeting.newBuilder().setMultiAbiTargeting(MULTI_ABI_WITH_ALTERNATIVES).build();
    assertThat(TargetingUtils.variantMultiAbiTargeting(ImmutableSet.of(ImmutableSet.of(X86), ImmutableSet.of(ARMEABI_V7A, ARM64_V8A)), ImmutableSet.of(ImmutableSet.of(X86_64)))).ignoringRepeatedFieldOrder().isEqualTo(expectedTargeting);
}
Also used : VariantTargeting(com.android.bundle.Targeting.VariantTargeting) Test(org.junit.Test)

Example 4 with VariantTargeting

use of com.android.bundle.Targeting.VariantTargeting in project bundletool by google.

the class TargetingUtilsTest method variantMultiAbiTargeting_byMultiAbiTargeting.

@Test
public void variantMultiAbiTargeting_byMultiAbiTargeting() {
    VariantTargeting expectedTargeting = VariantTargeting.newBuilder().setMultiAbiTargeting(MULTI_ABI_WITH_ALTERNATIVES).build();
    assertThat(TargetingUtils.variantMultiAbiTargeting(MULTI_ABI_WITH_ALTERNATIVES)).ignoringRepeatedFieldOrder().isEqualTo(expectedTargeting);
}
Also used : VariantTargeting(com.android.bundle.Targeting.VariantTargeting) Test(org.junit.Test)

Example 5 with VariantTargeting

use of com.android.bundle.Targeting.VariantTargeting in project bundletool by google.

the class VariantGeneratorTest method variantsWithV3SigningRestrictedToRPlus.

@Test
public void variantsWithV3SigningRestrictedToRPlus() throws Exception {
    BundleModule bundleModule = new BundleModuleBuilder("testModule").setManifest(androidManifest("com.test.app")).build();
    VariantGenerator variantGenerator = new VariantGenerator();
    ImmutableCollection<VariantTargeting> splits = variantGenerator.generateVariants(bundleModule, ApkGenerationConfiguration.builder().setMinSdkForAdditionalVariantWithV3Rotation(ANDROID_R_API_VERSION).build());
    assertThat(splits).containsExactly(lPlusVariantTargeting(), variantMinSdkTargeting(ANDROID_R_API_VERSION));
}
Also used : BundleModuleBuilder(com.android.tools.build.bundletool.testing.BundleModuleBuilder) TargetingUtils.lPlusVariantTargeting(com.android.tools.build.bundletool.testing.TargetingUtils.lPlusVariantTargeting) VariantTargeting(com.android.bundle.Targeting.VariantTargeting) BundleModule(com.android.tools.build.bundletool.model.BundleModule) Test(org.junit.Test)

Aggregations

VariantTargeting (com.android.bundle.Targeting.VariantTargeting)37 Test (org.junit.Test)31 ModuleSplit (com.android.tools.build.bundletool.model.ModuleSplit)16 TargetingUtils.mergeVariantTargeting (com.android.tools.build.bundletool.testing.TargetingUtils.mergeVariantTargeting)16 BundleModule (com.android.tools.build.bundletool.model.BundleModule)12 BundleModuleBuilder (com.android.tools.build.bundletool.testing.BundleModuleBuilder)9 SdkVersion (com.android.bundle.Targeting.SdkVersion)6 ImmutableSet (com.google.common.collect.ImmutableSet)6 AssetSliceSet (com.android.bundle.Commands.AssetSliceSet)5 ApkTargeting (com.android.bundle.Targeting.ApkTargeting)5 GeneratedApks (com.android.tools.build.bundletool.model.GeneratedApks)5 TargetingUtils.lPlusVariantTargeting (com.android.tools.build.bundletool.testing.TargetingUtils.lPlusVariantTargeting)5 ImmutableList (com.google.common.collect.ImmutableList)5 AndroidManifest (com.android.tools.build.bundletool.model.AndroidManifest)4 Configuration (com.android.aapt.ConfigurationOuterClass.Configuration)3 BundleConfig (com.android.bundle.Config.BundleConfig)3 ApexImages (com.android.bundle.Files.ApexImages)3 ResourceTableBuilder (com.android.tools.build.bundletool.testing.ResourceTableBuilder)3 ImmutableSet.toImmutableSet (com.google.common.collect.ImmutableSet.toImmutableSet)3 ApexManifest (com.android.apex.ApexManifestProto.ApexManifest)2