Search in sources :

Example 41 with ModuleEntry

use of com.android.tools.build.bundletool.model.ModuleEntry in project bundletool by google.

the class SystemApksGeneratorTest method uncompressedDexFiles_disabled.

@Test
public void uncompressedDexFiles_disabled() throws Exception {
    BundleModule baseModule = new BundleModuleBuilder("base").addFile("dex/classes.dex").setManifest(androidManifestForFeature("com.test.app")).build();
    ApkOptimizations apkOptimizations = splitOptimizations().toBuilder().setUncompressDexFiles(false).build();
    ImmutableList<ModuleSplit> shards = systemApksGenerator.generateSystemApks(/* modules= */
    ImmutableList.of(baseModule), /* modulesToFuse= */
    ImmutableSet.of(BASE_MODULE_NAME), apkOptimizations);
    assertThat(shards).hasSize(1);
    ModuleSplit fatApk = shards.get(0);
    assertThat(fatApk.findEntry("dex/classes.dex").map(ModuleEntry::getForceUncompressed)).hasValue(false);
}
Also used : BundleModuleBuilder(com.android.tools.build.bundletool.testing.BundleModuleBuilder) ModuleEntry(com.android.tools.build.bundletool.model.ModuleEntry) ApkOptimizations(com.android.tools.build.bundletool.optimizations.ApkOptimizations) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) BundleModule(com.android.tools.build.bundletool.model.BundleModule) Test(org.junit.Test)

Aggregations

ModuleEntry (com.android.tools.build.bundletool.model.ModuleEntry)41 ModuleSplit (com.android.tools.build.bundletool.model.ModuleSplit)22 ZipPath (com.android.tools.build.bundletool.model.ZipPath)18 ImmutableList (com.google.common.collect.ImmutableList)18 Test (org.junit.Test)13 BundleModule (com.android.tools.build.bundletool.model.BundleModule)12 ImmutableSet (com.google.common.collect.ImmutableSet)12 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)10 SpecialModuleEntry (com.android.tools.build.bundletool.model.BundleModule.SpecialModuleEntry)8 BundleModuleBuilder (com.android.tools.build.bundletool.testing.BundleModuleBuilder)6 HashMap (java.util.HashMap)6 Optional (java.util.Optional)6 TargetedAssetsDirectory (com.android.bundle.Files.TargetedAssetsDirectory)5 ImmutableSet.toImmutableSet (com.google.common.collect.ImmutableSet.toImmutableSet)5 IOException (java.io.IOException)5 Map (java.util.Map)5 ResourceTable (com.android.aapt.Resources.ResourceTable)4 ApkTargeting (com.android.bundle.Targeting.ApkTargeting)4 BundleModuleName (com.android.tools.build.bundletool.model.BundleModuleName)4 ApkOptimizations (com.android.tools.build.bundletool.optimizations.ApkOptimizations)4