use of aQute.bnd.osgi.resource.ResourceBuilder in project bnd by bndtools.
the class AugmentRepository method executeAugmentOperations.
private void executeAugmentOperations(Map<Requirement, Collection<Capability>> allBundles, Requirement bundleRequirement, List<Augment> augments) throws Exception {
Collection<Capability> matchedBundleCapabilities = allBundles.get(bundleRequirement);
Collection<Resource> bundles = ResourceUtils.getResources(matchedBundleCapabilities);
for (Resource bundle : bundles) {
ResourceBuilder wrappedBundleBuilder = new ResourceBuilder();
Map<Capability, Capability> originalToWrapper = wrappedBundleBuilder.from(bundle);
wrapped.putAll(originalToWrapper);
List<Augment> bundleAugments = augments;
for (Augment augment : bundleAugments) {
List<Capability> addedCapabilities = augment(augment, wrappedBundleBuilder);
augmentedCapabilities.addAll(addedCapabilities);
}
Resource wrappedBundle = wrappedBundleBuilder.build();
augmentedBundles.add(wrappedBundle);
}
}
Aggregations