Class ProjectBuilder

All Implemented Interfaces:
Constants, Registry, Report, Reporter, Closeable, AutoCloseable, Iterable<String>

public class ProjectBuilder extends Builder
  • Field Details

    • pomPropertiesFilter

      private static final Predicate<String> pomPropertiesFilter
    • logger

      private static final org.slf4j.Logger logger
    • differ

      private final DiffPluginImpl differ
    • project

      Project project
    • initialized

      boolean initialized
    • includeTestpath

      boolean includeTestpath
    • buildInfo

    • PATTERN_EXPORT_PACKAGE

      private static final Pattern PATTERN_EXPORT_PACKAGE
    • PATTERN_EXPORT_CONTENTS

      private static final Pattern PATTERN_EXPORT_CONTENTS
    • PATTERN_VERSION_ANNOTATION

      private static final Pattern PATTERN_VERSION_ANNOTATION
    • PATTERN_VERSION_PACKAGEINFO

      private static final Pattern PATTERN_VERSION_PACKAGEINFO
  • Constructor Details

    • ProjectBuilder

      public ProjectBuilder(Project project)
    • ProjectBuilder

      public ProjectBuilder(ProjectBuilder builder)
  • Method Details

    • lastModified

      public long lastModified()
      Overrides:
      lastModified in class Processor
    • getMacroDomains

      protected Object[] getMacroDomains()
      We put our project and our workspace on the macro path.
      Overrides:
      getMacroDomains in class Processor
    • getSubBuilder

      public Builder getSubBuilder() throws Exception
      Overrides:
      getSubBuilder in class Builder
      Throws:
      Exception
    • getProject

      public Project getProject()
    • init

      public void init()
      Description copied from class: Builder
      Allow any local initialization by subclasses before we build.
      Overrides:
      init in class Builder
    • addClasspath

      private void addClasspath(Parameters dependencies, Container c) throws IOException
      Throws:
      IOException
    • addClasspath

      public void addClasspath(Container c) throws IOException
      Throws:
      IOException
    • getClasspath

      public List<Jar> getClasspath()
      Overrides:
      getClasspath in class Analyzer
    • changedFile

      protected void changedFile(File f)
      Overrides:
      changedFile in class Builder
    • doBaseline

      public void doBaseline(Jar dot) throws Exception
      Compare this builder's JAR with a baseline
      Overrides:
      doBaseline in class Builder
      Throws:
      Exception
    • fillInLocationForPackageInfo

      public void fillInLocationForPackageInfo(Report.Location location, String packageName) throws Exception
      Throws:
      Exception
    • getLastRevision

      public Jar getLastRevision() throws Exception
      Throws:
      Exception
    • getBaselineJar

      public Jar getBaselineJar() throws Exception
      This method attempts to find the baseline jar for the current project. It reads the -baseline property and treats it as instructions. These instructions are matched against the bsns of the jars (think sub builders!). If they match, the sub builder is selected.

      The instruction can then specify the following options:

        version :
       baseline version from repository file : a file path
       
      If neither is specified, the current version is used to find the highest version (without qualifier) that is below the current version. If a version is specified, we take the highest version with the same base version.

      Since baselining is expensive and easily generates errors you must enable it. The easiest solution is to -baseline: *. This will match all sub builders and will calculate the version.

      Returns:
      a Jar or null
      Throws:
      Exception
    • removeStagedAndFilter

      private SortedSet<Version> removeStagedAndFilter(SortedSet<Version> versions, RepositoryPlugin repo, String bsn) throws Exception
      Remove any staging versions that have a variant with a higher qualifier.
      Parameters:
      versions -
      repo -
      Throws:
      Exception
    • isMaster

      private boolean isMaster(InfoRepository repo, String bsn, Version v) throws Exception
      Check if we have a master phase.
      Parameters:
      repo -
      bsn -
      v -
      Throws:
      Exception
    • getReleaseRepo

      private RepositoryPlugin getReleaseRepo()
    • getBaselineRepo

      private RepositoryPlugin getBaselineRepo()
    • report

      public void report(Map<String,Object> table) throws Exception
      Create a report of the settings
      Overrides:
      report in class Builder
      Throws:
      Exception
    • toString

      public String toString()
      Description copied from class: Processor
      Printout of the status of this processor for toString()
      Overrides:
      toString in class Processor
    • getExportedRuns

      public List<Run> getExportedRuns() throws Exception
      Return the bndrun files that need to be exported
      Throws:
      Exception
    • doExports

      Map<File,Resource> doExports(Map<File,List<Attrs>> entries)
    • builds

      public Jar[] builds() throws Exception
      Add some extra stuff to the builds() method like exporting.
      Overrides:
      builds in class Builder
      Throws:
      Exception
    • startBuild

      protected void startBuild(Builder builder) throws Exception
      Called when we start to build a builder. We reset our map of bsn -> version and set the default contents of the bundle.
      Overrides:
      startBuild in class Builder
      Throws:
      Exception
    • doneBuild

      protected void doneBuild(Builder builder) throws Exception
      Called when we're done with a builder. In this case we retrieve package information from builder.
      Overrides:
      doneBuild in class Builder
      Throws:
      Exception
    • xrefClasspath

      private void xrefClasspath(Map<String,Container> unreferencedClasspathEntries, Packages packages)
    • getSourceFileFor

      public String getSourceFileFor(Descriptors.TypeRef type) throws Exception
      Find the source file for this type
      Overrides:
      getSourceFileFor in class Analyzer
      Parameters:
      type -
      Throws:
      Exception
    • isInteractive

      public boolean isInteractive()
      Description copied from class: Processor
      Return if this is an interactive environment like Eclipse or runs in batch mode. If interactive, things can get refreshed.
      Overrides:
      isInteractive in class Processor
    • includeTestpath

      public ProjectBuilder includeTestpath()
    • getBuildInfo

      public ProjectBuilder.BuildInfoImpl getBuildInfo()