use of aQute.bnd.service.AnalyzerPlugin in project bnd by bndtools.
the class VerifierPluginTest method testNoVerifierPluginExecution.
public static void testNoVerifierPluginExecution() throws Exception {
final AtomicBoolean executedCheck = new AtomicBoolean(false);
AnalyzerPlugin analyzerPlugin = new AnalyzerPlugin() {
@Override
public boolean analyzeJar(Analyzer analyzer) throws Exception {
// The following is null when AnalyzerPlugins execute
Packages exports = analyzer.getExports();
if (exports == null) {
executedCheck.set(true);
}
return false;
}
};
try (Builder b = new Builder()) {
b.setProperty("Bundle-SymbolicName", "p1");
b.setProperty("Bundle-Version", "1.2.3");
b.setExportPackage("test.activator");
b.addClasspath(new File("bin"));
b.getPlugins().add(analyzerPlugin);
Jar jar = b.build();
}
assertTrue(executedCheck.get());
}
use of aQute.bnd.service.AnalyzerPlugin in project bnd by bndtools.
the class Analyzer method doPlugins.
/**
*
*/
void doPlugins() {
for (AnalyzerPlugin plugin : getPlugins(AnalyzerPlugin.class)) {
try {
boolean reanalyze;
Processor previous = beginHandleErrors(plugin.toString());
try {
reanalyze = plugin.analyzeJar(this);
} finally {
endHandleErrors(previous);
}
if (reanalyze) {
classspace.clear();
analyzeBundleClasspath();
}
} catch (Exception e) {
exception(e, "Analyzer Plugin %s failed %s", plugin, e);
}
}
}
Aggregations