use of com.android.tools.build.bundletool.splitters.ApkGenerationConfiguration in project bundletool by google.
the class BuildApksManager method getCommonSplitApkGenerationConfiguration.
private ApkGenerationConfiguration.Builder getCommonSplitApkGenerationConfiguration(AppBundle appBundle) {
BundleConfig bundleConfig = appBundle.getBundleConfig();
Version bundleToolVersion = Version.of(bundleConfig.getBundletool().getVersion());
ApkGenerationConfiguration.Builder apkGenerationConfiguration = ApkGenerationConfiguration.builder().setOptimizationDimensions(apkOptimizations.getSplitDimensions());
apkGenerationConfiguration.setEnableUncompressedNativeLibraries(apkOptimizations.getUncompressNativeLibraries());
apkGenerationConfiguration.setEnableDexCompressionSplitter(apkOptimizations.getUncompressDexFiles());
apkGenerationConfiguration.setInstallableOnExternalStorage(appBundle.getBaseModule().getAndroidManifest().getInstallLocationValue().map(installLocation -> installLocation.equals("auto") || installLocation.equals("preferExternal")).orElse(false));
apkGenerationConfiguration.setMasterPinnedResourceIds(appBundle.getMasterPinnedResourceIds());
apkGenerationConfiguration.setMasterPinnedResourceNames(appBundle.getMasterPinnedResourceNames());
apkGenerationConfiguration.setSuffixStrippings(apkOptimizations.getSuffixStrippings());
command.getMinSdkForAdditionalVariantWithV3Rotation().ifPresent(apkGenerationConfiguration::setMinSdkForAdditionalVariantWithV3Rotation);
return apkGenerationConfiguration;
}
use of com.android.tools.build.bundletool.splitters.ApkGenerationConfiguration in project bundletool by google.
the class BuildApksManager method generateAssetSlices.
private ImmutableList<ModuleSplit> generateAssetSlices(AppBundle appBundle) {
ApkGenerationConfiguration assetSlicesGenerationConfiguration = getAssetSliceGenerationConfiguration();
AssetSlicesGenerator assetSlicesGenerator = new AssetSlicesGenerator(appBundle, assetSlicesGenerationConfiguration, command.getAssetModulesVersionOverride());
return assetSlicesGenerator.generateAssetSlices();
}
use of com.android.tools.build.bundletool.splitters.ApkGenerationConfiguration in project bundletool by google.
the class BuildApksManager method generateInstantApks.
private ImmutableList<ModuleSplit> generateInstantApks(AppBundle appBundle) {
ImmutableList<BundleModule> allFeatureModules = appBundle.getFeatureModules().values().asList();
ImmutableList<BundleModule> instantModules = allFeatureModules.stream().filter(BundleModule::isInstantModule).collect(toImmutableList());
ApkGenerationConfiguration instantApkGenerationConfiguration = getCommonSplitApkGenerationConfiguration(appBundle).setForInstantAppVariants(true).setEnableDexCompressionSplitter(false).build();
return splitApksGenerator.generateSplits(instantModules, instantApkGenerationConfiguration);
}
Aggregations