Search in sources :

Example 1 with SourceStamp

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

the class SplitApksGenerator method generateSplitApks.

private ImmutableList<ModuleSplit> generateSplitApks(ImmutableList<BundleModule> modules, ApkGenerationConfiguration apkGenerationConfiguration, VariantTargeting variantTargeting) {
    ImmutableSet<String> allModuleNames = modules.stream().map(module -> module.getName().getName()).collect(toImmutableSet());
    ImmutableList.Builder<ModuleSplit> splits = ImmutableList.builder();
    for (BundleModule module : modules) {
        ModuleSplitter moduleSplitter = ModuleSplitter.create(module, bundletoolVersion, appBundle, apkGenerationConfiguration, variantTargeting, allModuleNames, stampSource.map(SourceStamp::getSource), StampType.STAMP_TYPE_DISTRIBUTION_APK);
        splits.addAll(moduleSplitter.splitModule());
    }
    return splits.build();
}
Also used : SourceStamp(com.android.tools.build.bundletool.model.SourceStamp) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) StampType(com.android.tools.build.bundletool.model.SourceStamp.StampType) Inject(javax.inject.Inject) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) ImmutableList(com.google.common.collect.ImmutableList) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) Optional(java.util.Optional) TargetingUtils.generateAllVariantTargetings(com.android.tools.build.bundletool.model.targeting.TargetingUtils.generateAllVariantTargetings) Version(com.android.tools.build.bundletool.model.version.Version) AppBundle(com.android.tools.build.bundletool.model.AppBundle) BundleModule(com.android.tools.build.bundletool.model.BundleModule) VariantTargeting(com.android.bundle.Targeting.VariantTargeting) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ImmutableList(com.google.common.collect.ImmutableList) ModuleSplit(com.android.tools.build.bundletool.model.ModuleSplit) BundleModule(com.android.tools.build.bundletool.model.BundleModule)

Aggregations

VariantTargeting (com.android.bundle.Targeting.VariantTargeting)1 AppBundle (com.android.tools.build.bundletool.model.AppBundle)1 BundleModule (com.android.tools.build.bundletool.model.BundleModule)1 ModuleSplit (com.android.tools.build.bundletool.model.ModuleSplit)1 SourceStamp (com.android.tools.build.bundletool.model.SourceStamp)1 StampType (com.android.tools.build.bundletool.model.SourceStamp.StampType)1 TargetingUtils.generateAllVariantTargetings (com.android.tools.build.bundletool.model.targeting.TargetingUtils.generateAllVariantTargetings)1 Version (com.android.tools.build.bundletool.model.version.Version)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 ImmutableSet.toImmutableSet (com.google.common.collect.ImmutableSet.toImmutableSet)1 Optional (java.util.Optional)1 Inject (javax.inject.Inject)1