use of com.android.bundle.Config.SplitDimension in project bundletool by google.
the class ModuleSplitterForShards method stripAssetsWithTargeting.
private static ModuleSplit stripAssetsWithTargeting(ModuleSplit split, ImmutableList<SplitDimension> dimensionsToStrip) {
for (SplitDimension dimension : dimensionsToStrip) {
checkArgument(SUFFIX_STRIPPING_DIMENSIONS.contains(dimension.getValue()));
split = SuffixStripper.createForDimension(dimension.getValue()).applySuffixStripping(split, dimension.getSuffixStripping());
}
return split;
}
use of com.android.bundle.Config.SplitDimension in project bundletool by google.
the class TextureCompressionFormatParityValidator method validateBundle.
@Override
public void validateBundle(AppBundle bundle) {
BundleConfig bundleConfig = bundle.getBundleConfig();
Optimizations optimizations = bundleConfig.getOptimizations();
List<SplitDimension> splitDimensions = optimizations.getSplitsConfig().getSplitDimensionList();
Optional<String> tcfDefaultSuffix = splitDimensions.stream().filter(dimension -> dimension.getValue().equals(Value.TEXTURE_COMPRESSION_FORMAT)).map(dimension -> dimension.getSuffixStripping().getDefaultSuffix()).collect(toOptional());
if (tcfDefaultSuffix.isPresent()) {
// Get the default texture compression format targeting, or an empty optional if fallback
// must be used.
Optional<TextureCompressionFormatTargeting> defaultTextureCompressionFormat = Optional.ofNullable(TextureCompressionUtils.TEXTURE_TO_TARGETING.get(tcfDefaultSuffix.get()));
validateFormatSupportedByAllModules(bundle, defaultTextureCompressionFormat);
}
}
Aggregations