use of aQute.bnd.service.MakePlugin in project bnd by bndtools.
the class Make method process.
public Resource process(String source) {
Map<Instruction, Map<String, String>> make = getMakeHeader();
logger.debug("make {}", source);
for (Map.Entry<Instruction, Map<String, String>> entry : make.entrySet()) {
Instruction instr = entry.getKey();
Matcher m = instr.getMatcher(source);
if (m.matches() || instr.isNegated()) {
Map<String, String> arguments = replace(m, entry.getValue());
List<MakePlugin> plugins = builder.getPlugins(MakePlugin.class);
for (MakePlugin plugin : plugins) {
try {
Resource resource = plugin.make(builder, source, arguments);
if (resource != null) {
logger.debug("Made {} from args {} with {}", source, arguments, plugin);
return resource;
}
} catch (Exception e) {
builder.exception(e, "Plugin %s generates error when use in making %s with args %s", plugin, source, arguments);
}
}
}
}
return null;
}
Aggregations