Search in sources :

Example 6 with LanguageTargeting

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

the class LocaleConfigXmlInjectorTest method process.

@Test
public void process() throws Exception {
    ModuleSplit baseMasterSplit = createModuleSplit(new ResourceTableBuilder().addPackage("com.example.app.module").build(), BASE_MODULE_NAME.getName(), /* masterSplit= */
    true, SPLIT, /* languageTargeting= */
    null);
    ModuleSplit otherSplitA = createModuleSplit(new ResourceTableBuilder().addPackage("com.example.app.module").addStringResourceForMultipleLocales("module", ImmutableMap.of("ru-RU", "module ru-RU")).build(), BASE_MODULE_NAME.getName(), /* masterSplit= */
    false, SPLIT, languageTargeting("ru"));
    ModuleSplit otherSplitB = createModuleSplit(new ResourceTableBuilder().addPackage("com.example.app.module").addStringResourceForMultipleLocales("module", ImmutableMap.of("fr", "module fr")).build(), BASE_MODULE_NAME.getName(), /* masterSplit= */
    false, SPLIT, languageTargeting("fr"));
    ModuleSplit otherSplitC = createModuleSplit(new ResourceTableBuilder().addPackage("com.example.app.module").addStringResourceForMultipleLocales("module", ImmutableMap.of("en-AU", "module en-AU")).build(), "module", /* masterSplit= */
    false, SPLIT, languageTargeting("en"));
    ImmutableList<ModuleSplit> otherSplits = ImmutableList.of(otherSplitA, otherSplitB, otherSplitC);
    ImmutableList<ModuleSplit> processedSplits = localeConfigXmlInjector.process(VariantKey.create(baseMasterSplit), ImmutableList.<ModuleSplit>builder().add(baseMasterSplit).addAll(otherSplits).build());
    ModuleSplit processedBaseMasterSplit = processedSplits.stream().filter(ModuleSplit::isMasterSplit).collect(onlyElement());
    assertThat(processedBaseMasterSplit.getAndroidManifest().hasLocaleConfig()).isTrue();
    assertThat(processedBaseMasterSplit.getResourceTable().get()).containsResource("com.example.app.module:xml/locales_config").withFileReference("res/xml/locales_config.xml");
    XmlNode expectedLocaleConfigProtoXml = createLocalesXmlNode(new HashSet<>(Arrays.asList("ru-RU", "fr")));
    assertThat(XmlNode.parseFrom(processedBaseMasterSplit.getEntries().get(0).getContent().read(), ExtensionRegistry.getEmptyRegistry())).ignoringRepeatedFieldOrder().isEqualTo(expectedLocaleConfigProtoXml);
    ImmutableList<ModuleSplit> processedOtherSplits = processedSplits.stream().filter(split -> !split.isMasterSplit()).collect(toImmutableList());
    assertThat(processedOtherSplits).containsExactly(otherSplitA, otherSplitB, otherSplitC);
}
Also used : Arrays(java.util.Arrays) ApkTargeting(com.android.bundle.Targeting.ApkTargeting) BundleModuleName(com.android.tools.build.bundletool.model.BundleModuleName) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) VariantKey(com.android.tools.build.bundletool.model.VariantKey) XmlProtoNode(com.android.tools.build.bundletool.model.utils.xmlproto.XmlProtoNode) RunWith(org.junit.runner.RunWith) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) XmlProtoAttributeBuilder(com.android.tools.build.bundletool.model.utils.xmlproto.XmlProtoAttributeBuilder) BASE_MODULE_NAME(com.android.tools.build.bundletool.model.BundleModuleName.BASE_MODULE_NAME) MoreCollectors.onlyElement(com.google.common.collect.MoreCollectors.onlyElement) TruthResourceTable.assertThat(com.android.tools.build.bundletool.testing.truth.resources.TruthResourceTable.assertThat) HashSet(java.util.HashSet) ProtoTruth.assertThat(com.google.common.truth.extensions.proto.ProtoTruth.assertThat) ImmutableList(com.google.common.collect.ImmutableList) ResourceTableBuilder(com.android.tools.build.bundletool.testing.ResourceTableBuilder) Theories(org.junit.experimental.theories.Theories) TargetingUtils.languageTargeting(com.android.tools.build.bundletool.testing.TargetingUtils.languageTargeting) SYSTEM(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.SYSTEM) ResourceTable(com.android.aapt.Resources.ResourceTable) VariantTargeting(com.android.bundle.Targeting.VariantTargeting) Nullable(javax.annotation.Nullable) Before(org.junit.Before) XmlProtoElementBuilder(com.android.tools.build.bundletool.model.utils.xmlproto.XmlProtoElementBuilder) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) LanguageTargeting(com.android.bundle.Targeting.LanguageTargeting) SplitType(com.android.tools.build.bundletool.model.ModuleSplit.SplitType) XmlNode(com.android.aapt.Resources.XmlNode) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) ExtensionRegistry(com.google.protobuf.ExtensionRegistry) SPLIT(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.SPLIT) XmlNode(com.android.aapt.Resources.XmlNode) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) ResourceTableBuilder(com.android.tools.build.bundletool.testing.ResourceTableBuilder) Test(org.junit.Test)

Example 7 with LanguageTargeting

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

the class ModuleSplit method getSuffix.

/**
 * Returns the split suffix base name based on the targeting.
 *
 * <p>The split suffix cannot contain dashes as they are not allowed by the Android Framework. We
 * replace them with underscores instead.
 */
public String getSuffix() {
    if (isMasterSplit()) {
        return "";
    }
    StringJoiner suffixJoiner = new StringJoiner("_");
    // The dimensions below should be ordered by their priority.
    AbiTargeting abiTargeting = getApkTargeting().getAbiTargeting();
    if (!abiTargeting.getValueList().isEmpty()) {
        abiTargeting.getValueList().forEach(value -> suffixJoiner.add(formatAbi(value)));
    } else if (!abiTargeting.getAlternativesList().isEmpty()) {
        suffixJoiner.add("other_abis");
    }
    MultiAbiTargeting multiAbiTargeting = getApkTargeting().getMultiAbiTargeting();
    for (MultiAbi value : multiAbiTargeting.getValueList()) {
        suffixJoiner.add(MULTI_ABI_SUFFIX_JOINER.join(value.getAbiList().stream().map(ModuleSplit::formatAbi).collect(toImmutableList())));
    }
    // Alternatives without values are not supported for MultiAbiTargeting.
    SanitizerTargeting sanitizerTargeting = getApkTargeting().getSanitizerTargeting();
    for (Sanitizer sanitizer : sanitizerTargeting.getValueList()) {
        if (sanitizer.getAlias().equals(SanitizerAlias.HWADDRESS)) {
            suffixJoiner.add("hwasan");
        } else {
            throw new IllegalArgumentException("Unknown sanitizer");
        }
    }
    LanguageTargeting languageTargeting = getApkTargeting().getLanguageTargeting();
    if (!languageTargeting.getValueList().isEmpty()) {
        languageTargeting.getValueList().forEach(suffixJoiner::add);
    } else if (!languageTargeting.getAlternativesList().isEmpty()) {
        suffixJoiner.add("other_lang");
    }
    getApkTargeting().getScreenDensityTargeting().getValueList().forEach(value -> suffixJoiner.add(SCREEN_DENSITY_TO_PROTO_VALUE_MAP.inverse().get(value.getDensityAlias()).replace('-', '_')));
    TextureCompressionFormatTargeting textureFormatTargeting = getApkTargeting().getTextureCompressionFormatTargeting();
    if (!textureFormatTargeting.getValueList().isEmpty()) {
        textureFormatTargeting.getValueList().forEach(value -> suffixJoiner.add(Ascii.toLowerCase(value.getAlias().name())));
    } else if (!textureFormatTargeting.getAlternativesList().isEmpty()) {
        suffixJoiner.add("other_tcf");
    }
    getApkTargeting().getDeviceTierTargeting().getValueList().forEach(value -> suffixJoiner.add("tier_" + value.getValue()));
    return suffixJoiner.toString();
}
Also used : LanguageTargeting(com.android.bundle.Targeting.LanguageTargeting) MultiAbiTargeting(com.android.bundle.Targeting.MultiAbiTargeting) AbiTargeting(com.android.bundle.Targeting.AbiTargeting) TextureCompressionFormatTargeting(com.android.bundle.Targeting.TextureCompressionFormatTargeting) SanitizerTargeting(com.android.bundle.Targeting.SanitizerTargeting) Sanitizer(com.android.bundle.Targeting.Sanitizer) MultiAbi(com.android.bundle.Targeting.MultiAbi) StringJoiner(java.util.StringJoiner) MultiAbiTargeting(com.android.bundle.Targeting.MultiAbiTargeting)

Example 8 with LanguageTargeting

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

the class SplitsXmlInjectorTest method process_noLanguageTargeting.

@Test
public void process_noLanguageTargeting() throws Exception {
    ResourceTable baseResourceTable = new ResourceTableBuilder().addPackage("com.example.app").addStringResourceForMultipleLocales("title", ImmutableMap.of("ru", "title ru-RU", "fr", "title fr", "es", "title es")).build();
    ModuleSplit baseModule = createModuleSplit(BASE_MODULE_NAME.getName(), /* splitId= */
    "", /* masterSplit= */
    true, SPLIT, /* languageTargeting= */
    null).toBuilder().setResourceTable(baseResourceTable).build();
    ResourceTable featureResourceTable = new ResourceTableBuilder().addPackage("com.example.app.module").addStringResourceForMultipleLocales("module_str", ImmutableMap.of("ru", "module ru-RU")).build();
    ModuleSplit featureModule = createModuleSplit("module", /* splitId= */
    "module", /* masterSplit= */
    true, SPLIT, /* languageTargeting= */
    null).toBuilder().setResourceTable(featureResourceTable).build();
    GeneratedApks generatedApks = GeneratedApks.fromModuleSplits(ImmutableList.of(baseModule, featureModule));
    ModuleSplit processedBaseMasterSplit = xmlInjectorProcess(generatedApks).stream().filter(module -> module.isMasterSplit() && module.isBaseModuleSplit()).collect(onlyElement());
    assertThat(processedBaseMasterSplit.getResourceTable().get()).containsResource("com.example.app:xml/splits0").withFileReference("res/xml/splits0.xml");
    XmlNode expectedSplitsProtoXml = new SplitsProtoXmlBuilder().addLanguageMapping(BundleModuleName.create("module"), "ru", "module").addLanguageMapping(BASE_MODULE_NAME, "ru", "").addLanguageMapping(BASE_MODULE_NAME, "fr", "").addLanguageMapping(BASE_MODULE_NAME, "es", "").build();
    Optional<ModuleEntry> splitsXml = processedBaseMasterSplit.findEntry("res/xml/splits0.xml");
    assertThat(splitsXml).isPresent();
    assertThat(XmlNode.parseFrom(splitsXml.get().getContent().read(), ExtensionRegistry.getEmptyRegistry())).ignoringRepeatedFieldOrder().isEqualTo(expectedSplitsProtoXml);
}
Also used : ARCHIVE(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.ARCHIVE) ApkTargeting(com.android.bundle.Targeting.ApkTargeting) BundleModuleName(com.android.tools.build.bundletool.model.BundleModuleName) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) RunWith(org.junit.runner.RunWith) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) BASE_MODULE_NAME(com.android.tools.build.bundletool.model.BundleModuleName.BASE_MODULE_NAME) MoreCollectors.onlyElement(com.google.common.collect.MoreCollectors.onlyElement) TruthResourceTable.assertThat(com.android.tools.build.bundletool.testing.truth.resources.TruthResourceTable.assertThat) ProtoTruth.assertThat(com.google.common.truth.extensions.proto.ProtoTruth.assertThat) ImmutableList(com.google.common.collect.ImmutableList) ResourceTableBuilder(com.android.tools.build.bundletool.testing.ResourceTableBuilder) Theories(org.junit.experimental.theories.Theories) TargetingUtils.languageTargeting(com.android.tools.build.bundletool.testing.TargetingUtils.languageTargeting) SYSTEM(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.SYSTEM) STANDALONE(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.STANDALONE) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) ResourceTable(com.android.aapt.Resources.ResourceTable) VariantTargeting(com.android.bundle.Targeting.VariantTargeting) Nullable(javax.annotation.Nullable) Before(org.junit.Before) INSTANT(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.INSTANT) ImmutableMap(com.google.common.collect.ImmutableMap) TestUtils.createModuleEntryForFile(com.android.tools.build.bundletool.testing.TestUtils.createModuleEntryForFile) UTF_8(java.nio.charset.StandardCharsets.UTF_8) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Collection(java.util.Collection) SplitsProtoXmlBuilder(com.android.tools.build.bundletool.model.SplitsProtoXmlBuilder) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) LanguageTargeting(com.android.bundle.Targeting.LanguageTargeting) SplitType(com.android.tools.build.bundletool.model.ModuleSplit.SplitType) GeneratedApks(com.android.tools.build.bundletool.model.GeneratedApks) XmlNode(com.android.aapt.Resources.XmlNode) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) ModuleEntry(com.android.tools.build.bundletool.model.ModuleEntry) ExtensionRegistry(com.google.protobuf.ExtensionRegistry) Optional(java.util.Optional) SPLIT(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.SPLIT) XmlNode(com.android.aapt.Resources.XmlNode) GeneratedApks(com.android.tools.build.bundletool.model.GeneratedApks) SplitsProtoXmlBuilder(com.android.tools.build.bundletool.model.SplitsProtoXmlBuilder) ModuleEntry(com.android.tools.build.bundletool.model.ModuleEntry) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) ResourceTableBuilder(com.android.tools.build.bundletool.testing.ResourceTableBuilder) ResourceTable(com.android.aapt.Resources.ResourceTable) Test(org.junit.Test)

Example 9 with LanguageTargeting

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

the class SplitsXmlInjectorTest method process_systemSplits.

@Test
public void process_systemSplits() throws Exception {
    ModuleSplit baseMasterSplit = createModuleSplit(BASE_MODULE_NAME.getName(), /* splitId= */
    "", /* masterSplit= */
    true, SYSTEM, languageTargeting("es"));
    ImmutableList<ModuleSplit> otherSplits = ImmutableList.of(createModuleSplit(BASE_MODULE_NAME.getName(), /* splitId= */
    "config.ru", /* masterSplit= */
    false, SYSTEM, languageTargeting("ru")), createModuleSplit(BASE_MODULE_NAME.getName(), /* splitId= */
    "config.fr", /* masterSplit= */
    false, SYSTEM, languageTargeting("fr")), createModuleSplit("module", /* splitId= */
    "module.config.ru", /* masterSplit= */
    false, SYSTEM, languageTargeting("ru")));
    GeneratedApks generatedApks = GeneratedApks.fromModuleSplits(ImmutableList.<ModuleSplit>builder().add(baseMasterSplit).addAll(otherSplits).build());
    assertThat(generatedApks.getAllApksStream()).containsAtLeastElementsIn(otherSplits);
    ModuleSplit processedBaseMasterSplit = xmlInjectorProcess(generatedApks).stream().filter(module -> module.isMasterSplit() && module.isBaseModuleSplit()).collect(onlyElement());
    assertThat(processedBaseMasterSplit.getAndroidManifest().getMetadataResourceId("com.android.vending.splits")).hasValue(0x7f010000);
    assertThat(processedBaseMasterSplit.getResourceTable().get()).containsResource("com.example.app:xml/splits0").withFileReference("res/xml/splits0.xml");
    XmlNode expectedSplitsProtoXml = new SplitsProtoXmlBuilder().addLanguageMapping(BundleModuleName.create("module"), "ru", "module.config.ru").addLanguageMapping(BASE_MODULE_NAME, "ru", "config.ru").addLanguageMapping(BASE_MODULE_NAME, "fr", "config.fr").addLanguageMapping(BASE_MODULE_NAME, "es", "").build();
    assertThat(XmlNode.parseFrom(processedBaseMasterSplit.getEntries().get(0).getContent().read())).ignoringRepeatedFieldOrder().isEqualTo(expectedSplitsProtoXml);
}
Also used : ARCHIVE(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.ARCHIVE) ApkTargeting(com.android.bundle.Targeting.ApkTargeting) BundleModuleName(com.android.tools.build.bundletool.model.BundleModuleName) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) RunWith(org.junit.runner.RunWith) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) BASE_MODULE_NAME(com.android.tools.build.bundletool.model.BundleModuleName.BASE_MODULE_NAME) MoreCollectors.onlyElement(com.google.common.collect.MoreCollectors.onlyElement) TruthResourceTable.assertThat(com.android.tools.build.bundletool.testing.truth.resources.TruthResourceTable.assertThat) ProtoTruth.assertThat(com.google.common.truth.extensions.proto.ProtoTruth.assertThat) ImmutableList(com.google.common.collect.ImmutableList) ResourceTableBuilder(com.android.tools.build.bundletool.testing.ResourceTableBuilder) Theories(org.junit.experimental.theories.Theories) TargetingUtils.languageTargeting(com.android.tools.build.bundletool.testing.TargetingUtils.languageTargeting) SYSTEM(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.SYSTEM) STANDALONE(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.STANDALONE) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) ResourceTable(com.android.aapt.Resources.ResourceTable) VariantTargeting(com.android.bundle.Targeting.VariantTargeting) Nullable(javax.annotation.Nullable) Before(org.junit.Before) INSTANT(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.INSTANT) ImmutableMap(com.google.common.collect.ImmutableMap) TestUtils.createModuleEntryForFile(com.android.tools.build.bundletool.testing.TestUtils.createModuleEntryForFile) UTF_8(java.nio.charset.StandardCharsets.UTF_8) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Collection(java.util.Collection) SplitsProtoXmlBuilder(com.android.tools.build.bundletool.model.SplitsProtoXmlBuilder) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) LanguageTargeting(com.android.bundle.Targeting.LanguageTargeting) SplitType(com.android.tools.build.bundletool.model.ModuleSplit.SplitType) GeneratedApks(com.android.tools.build.bundletool.model.GeneratedApks) XmlNode(com.android.aapt.Resources.XmlNode) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) ModuleEntry(com.android.tools.build.bundletool.model.ModuleEntry) ExtensionRegistry(com.google.protobuf.ExtensionRegistry) Optional(java.util.Optional) SPLIT(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.SPLIT) XmlNode(com.android.aapt.Resources.XmlNode) GeneratedApks(com.android.tools.build.bundletool.model.GeneratedApks) SplitsProtoXmlBuilder(com.android.tools.build.bundletool.model.SplitsProtoXmlBuilder) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) Test(org.junit.Test)

Example 10 with LanguageTargeting

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

the class SplitsXmlInjectorTest method process.

@Test
public void process() throws Exception {
    ModuleSplit baseMasterSplit = createModuleSplit(BASE_MODULE_NAME.getName(), /* splitId= */
    "", /* masterSplit= */
    true, SPLIT, /* languageTargeting= */
    null);
    ImmutableList<ModuleSplit> otherSplits = ImmutableList.of(createModuleSplit(BASE_MODULE_NAME.getName(), /* splitId= */
    "config.ru", /* masterSplit= */
    false, SPLIT, languageTargeting("ru")), createModuleSplit(BASE_MODULE_NAME.getName(), /* splitId= */
    "config.fr", /* masterSplit= */
    false, SPLIT, languageTargeting("fr")), createModuleSplit("module", /* splitId= */
    "module", /* masterSplit= */
    true, SPLIT, /* languageTargeting= */
    null), createModuleSplit("module", /* splitId= */
    "module.config.ru", /* masterSplit= */
    false, SPLIT, languageTargeting("ru")));
    GeneratedApks generatedApks = GeneratedApks.fromModuleSplits(ImmutableList.<ModuleSplit>builder().add(baseMasterSplit).addAll(otherSplits).build());
    assertThat(generatedApks.getAllApksStream()).containsAtLeastElementsIn(otherSplits);
    ModuleSplit processedBaseMasterSplit = xmlInjectorProcess(generatedApks).stream().filter(module -> module.isMasterSplit() && module.isBaseModuleSplit()).collect(onlyElement());
    assertThat(processedBaseMasterSplit.getAndroidManifest().getMetadataResourceId("com.android.vending.splits")).hasValue(0x7f010000);
    assertThat(processedBaseMasterSplit.getResourceTable().get()).containsResource("com.example.app:xml/splits0").withFileReference("res/xml/splits0.xml");
    XmlNode expectedSplitsProtoXml = new SplitsProtoXmlBuilder().addLanguageMapping(BundleModuleName.create("module"), "ru", "module.config.ru").addLanguageMapping(BASE_MODULE_NAME, "ru", "config.ru").addLanguageMapping(BASE_MODULE_NAME, "fr", "config.fr").build();
    assertThat(XmlNode.parseFrom(processedBaseMasterSplit.getEntries().get(0).getContent().read())).ignoringRepeatedFieldOrder().isEqualTo(expectedSplitsProtoXml);
}
Also used : ARCHIVE(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.ARCHIVE) ApkTargeting(com.android.bundle.Targeting.ApkTargeting) BundleModuleName(com.android.tools.build.bundletool.model.BundleModuleName) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) RunWith(org.junit.runner.RunWith) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) BASE_MODULE_NAME(com.android.tools.build.bundletool.model.BundleModuleName.BASE_MODULE_NAME) MoreCollectors.onlyElement(com.google.common.collect.MoreCollectors.onlyElement) TruthResourceTable.assertThat(com.android.tools.build.bundletool.testing.truth.resources.TruthResourceTable.assertThat) ProtoTruth.assertThat(com.google.common.truth.extensions.proto.ProtoTruth.assertThat) ImmutableList(com.google.common.collect.ImmutableList) ResourceTableBuilder(com.android.tools.build.bundletool.testing.ResourceTableBuilder) Theories(org.junit.experimental.theories.Theories) TargetingUtils.languageTargeting(com.android.tools.build.bundletool.testing.TargetingUtils.languageTargeting) SYSTEM(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.SYSTEM) STANDALONE(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.STANDALONE) Truth8.assertThat(com.google.common.truth.Truth8.assertThat) ResourceTable(com.android.aapt.Resources.ResourceTable) VariantTargeting(com.android.bundle.Targeting.VariantTargeting) Nullable(javax.annotation.Nullable) Before(org.junit.Before) INSTANT(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.INSTANT) ImmutableMap(com.google.common.collect.ImmutableMap) TestUtils.createModuleEntryForFile(com.android.tools.build.bundletool.testing.TestUtils.createModuleEntryForFile) UTF_8(java.nio.charset.StandardCharsets.UTF_8) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Collection(java.util.Collection) SplitsProtoXmlBuilder(com.android.tools.build.bundletool.model.SplitsProtoXmlBuilder) Test(org.junit.Test) Truth.assertThat(com.google.common.truth.Truth.assertThat) LanguageTargeting(com.android.bundle.Targeting.LanguageTargeting) SplitType(com.android.tools.build.bundletool.model.ModuleSplit.SplitType) GeneratedApks(com.android.tools.build.bundletool.model.GeneratedApks) XmlNode(com.android.aapt.Resources.XmlNode) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) ModuleEntry(com.android.tools.build.bundletool.model.ModuleEntry) ExtensionRegistry(com.google.protobuf.ExtensionRegistry) Optional(java.util.Optional) SPLIT(com.android.tools.build.bundletool.model.ModuleSplit.SplitType.SPLIT) XmlNode(com.android.aapt.Resources.XmlNode) GeneratedApks(com.android.tools.build.bundletool.model.GeneratedApks) SplitsProtoXmlBuilder(com.android.tools.build.bundletool.model.SplitsProtoXmlBuilder) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) Test(org.junit.Test)

Aggregations

LanguageTargeting (com.android.bundle.Targeting.LanguageTargeting)17 Test (org.junit.Test)15 ResourceTableBuilder (com.android.tools.build.bundletool.testing.ResourceTableBuilder)13 ApkTargeting (com.android.bundle.Targeting.ApkTargeting)12 VariantTargeting (com.android.bundle.Targeting.VariantTargeting)12 AndroidManifest (com.android.tools.build.bundletool.model.AndroidManifest)12 ManifestProtoUtils.androidManifest (com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest)12 TargetingUtils.languageTargeting (com.android.tools.build.bundletool.testing.TargetingUtils.languageTargeting)12 ImmutableList (com.google.common.collect.ImmutableList)12 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)12 ImmutableMap (com.google.common.collect.ImmutableMap)12 MoreCollectors.onlyElement (com.google.common.collect.MoreCollectors.onlyElement)12 Truth.assertThat (com.google.common.truth.Truth.assertThat)12 ProtoTruth.assertThat (com.google.common.truth.extensions.proto.ProtoTruth.assertThat)12 Before (org.junit.Before)12 Theories (org.junit.experimental.theories.Theories)12 RunWith (org.junit.runner.RunWith)12 ResourceTable (com.android.aapt.Resources.ResourceTable)7 XmlNode (com.android.aapt.Resources.XmlNode)7 TextureCompressionFormatTargeting (com.android.bundle.Targeting.TextureCompressionFormatTargeting)7