Search in sources :

Example 21 with DiffPluginImpl

use of aQute.bnd.differ.DiffPluginImpl 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;
}
Also used : DiffPluginImpl(aQute.bnd.differ.DiffPluginImpl) ProjectBuilder(aQute.bnd.build.ProjectBuilder) Jar(aQute.bnd.osgi.Jar) Baseline(aQute.bnd.differ.Baseline)

Aggregations

DiffPluginImpl (aQute.bnd.differ.DiffPluginImpl)21 Jar (aQute.bnd.osgi.Jar)20 Baseline (aQute.bnd.differ.Baseline)15 BundleInfo (aQute.bnd.differ.Baseline.BundleInfo)12 Processor (aQute.bnd.osgi.Processor)11 Info (aQute.bnd.differ.Baseline.Info)9 ProjectBuilder (aQute.bnd.build.ProjectBuilder)5 Builder (aQute.bnd.osgi.Builder)5 Tree (aQute.bnd.service.diff.Tree)5 Diff (aQute.bnd.service.diff.Diff)4 ReporterAdapter (aQute.libg.reporter.ReporterAdapter)2 File (java.io.File)2 Project (aQute.bnd.build.Project)1 Instructions (aQute.bnd.osgi.Instructions)1 Differ (aQute.bnd.service.diff.Differ)1 Version (aQute.bnd.version.Version)1 Reporter (aQute.service.reporter.Reporter)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1