use of aQute.bnd.differ.Baseline in project bndtools by bndtools.
the class InfoLabelProvider method getImage.
@Override
public Image getImage(Object element) {
if (element instanceof Baseline) {
//$NON-NLS-1$
Diff apiDiff = ((Baseline) element).getDiff() != null ? ((Baseline) element).getDiff().get("<api>") : null;
if (apiDiff == null) {
apiDiff = ((Baseline) element).getDiff();
}
//$NON-NLS-1$
return BundleTreeImages.resolveImage("bundle", apiDiff.getDelta().toString().toLowerCase(), null, null);
}
if (element instanceof Info) {
Info tree = (Info) element;
//$NON-NLS-1$
String type = "package";
//$NON-NLS-1$
String delta = "changed" + '_' + tree.packageDiff.getDelta().toString().toLowerCase();
//$NON-NLS-1$
String impExp = "export";
return BundleTreeImages.resolveImage(type, delta, impExp, null);
}
return null;
}
use of aQute.bnd.differ.Baseline in project bndtools by bndtools.
the class DiffHelper method createBaseline.
public static Baseline createBaseline(Builder builder) {
try {
if (builder instanceof ProjectBuilder) {
ProjectBuilder projectBuilder = (ProjectBuilder) builder;
Jar jar = null;
Jar currentJar = null;
try {
jar = builder.build();
currentJar = projectBuilder.getBaselineJar();
if (currentJar == null) {
currentJar = projectBuilder.getLastRevision();
}
if (currentJar == null) {
//$NON-NLS-1$
currentJar = new Jar(".");
}
DiffPluginImpl differ = new DiffPluginImpl();
String diffignore = builder.getProperty(Constants.DIFFIGNORE);
if (diffignore != null)
differ.setIgnore(diffignore);
Baseline baseline = new Baseline(builder, differ);
baseline.baseline(jar, currentJar, null);
return baseline;
} finally {
if (jar != null)
jar.close();
if (currentJar != null)
currentJar.close();
}
}
} catch (Exception e1) {
e1.printStackTrace();
}
return null;
}
Aggregations