use of aQute.bnd.service.diff.Differ in project bnd by bndtools.
the class DiffCommand method showTree.
/**
* Just show the single tree
*
* @param bnd
* @param options
* @throws Exception
*/
private static void showTree(bnd bnd, diffOptions options) throws Exception {
File fout = options.output();
PrintWriter pw;
if (fout == null)
pw = IO.writer(bnd.out);
else
pw = IO.writer(fout, UTF_8);
Instructions packageFilters = new Instructions(options.pack());
try (Jar newer = new Jar(bnd.getFile(options._arguments().get(0)))) {
Differ di = new DiffPluginImpl();
Tree n = di.tree(newer);
boolean all = options.api() == false && options.resources() == false && options.manifest() == false;
if (all || options.api())
for (Tree packageDiff : n.get("<api>").getChildren()) {
if (packageFilters.matches(packageDiff.getName()))
show(pw, packageDiff, 0);
}
if (all || options.manifest())
show(pw, n.get("<manifest>"), 0);
if (all || options.resources())
show(pw, n.get("<resources>"), 0);
} finally {
pw.close();
}
}
Aggregations