use of com.android.tools.build.bundletool.model.BundleModule.DEX_DIRECTORY in project bundletool by google.
the class BundleModuleMerger method getAllEntriesExceptDexAndSpecial.
private static ImmutableSet<ModuleEntry> getAllEntriesExceptDexAndSpecial(Set<BundleModule> bundleModulesToFuse) {
Map<ZipPath, ModuleEntry> mergedEntriesByPath = new HashMap<>();
bundleModulesToFuse.stream().flatMap(module -> module.getEntries().stream()).filter(moduleEntry -> !moduleEntry.getPath().startsWith(DEX_DIRECTORY) && !moduleEntry.isSpecialEntry()).forEach(moduleEntry -> {
ModuleEntry existingModuleEntry = mergedEntriesByPath.putIfAbsent(moduleEntry.getPath(), moduleEntry);
if (existingModuleEntry != null && !existingModuleEntry.equals(moduleEntry)) {
throw InvalidBundleException.builder().withUserMessage("Existing module entry '%s' with different contents.", moduleEntry.getPath()).build();
}
});
return ImmutableSet.copyOf(mergedEntriesByPath.values());
}
Aggregations