Class Project

  • All Implemented Interfaces:
    Constants, Registry, Report, Reporter, java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<java.lang.String>
    Direct Known Subclasses:
    Run

    public class Project
    extends Processor
    This class is NOT threadsafe
    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • BNDPATH

        static final java.nio.file.Path BNDPATH
      • preparedPaths

        private final java.util.concurrent.atomic.AtomicBoolean preparedPaths
      • dependenciesFull

        private final java.util.Set<Project> dependenciesFull
      • dependenciesBuild

        private final java.util.Set<Project> dependenciesBuild
      • dependenciesTest

        private final java.util.Set<Project> dependenciesTest
      • dependents

        private final java.util.Set<Project> dependents
      • classpath

        final java.util.Collection<Container> classpath
      • buildpath

        final java.util.Collection<Container> buildpath
      • testpath

        final java.util.Collection<Container> testpath
      • runpath

        final java.util.Collection<Container> runpath
      • runbundles

        final java.util.Collection<Container> runbundles
      • runfw

        final java.util.Collection<Container> runfw
      • runstorage

        java.io.File runstorage
      • sourcepath

        final java.util.Map<java.io.File,​Attrs> sourcepath
      • allsourcepath

        final java.util.Collection<java.io.File> allsourcepath
      • bootclasspath

        final java.util.Collection<Container> bootclasspath
      • versionMap

        final java.util.Map<java.lang.String,​Version> versionMap
      • output

        java.io.File output
      • target

        java.io.File target
      • revision

        private final java.util.concurrent.atomic.AtomicInteger revision
      • files

        private java.io.File[] files
      • delayRunDependencies

        boolean delayRunDependencies
      • ide

        private java.util.Properties ide
      • exportedPackages

        final Packages exportedPackages
      • importedPackages

        final Packages importedPackages
      • containedPackages

        final Packages containedPackages
      • unreferencedClasspathEntries

        public java.util.Map<java.lang.String,​Container> unreferencedClasspathEntries
      • _repoHelp

        static java.lang.String _repoHelp
        Macro access to the repository ${repo;[;[;]]}
      • ignore

        static java.util.List<java.lang.String> ignore
        Pack the project (could be a bndrun file) and save it on disk. Report errors if they happen.
    • Constructor Detail

      • Project

        public Project​(Workspace workspace,
                       java.io.File unused,
                       java.io.File buildFile)
      • Project

        public Project​(Workspace workspace,
                       java.io.File buildDir)
    • Method Detail

      • readBuildProperties

        private void readBuildProperties()
      • getUnparented

        public static Project getUnparented​(java.io.File propertiesFile)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isValid

        public boolean isValid()
      • getBuilder

        public ProjectBuilder getBuilder​(ProjectBuilder parent)
                                  throws java.lang.Exception
        Return a new builder that is nicely setup for this project. Please close this builder after use.
        Parameters:
        parent - The project builder to use as parent, use this project if null
        Throws:
        java.lang.Exception
      • getChanged

        public int getChanged()
      • setChanged

        public void setChanged()
      • getWorkspace

        public Workspace getWorkspace()
      • toString

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

        public void prepare()
                     throws java.lang.Exception
        Set up all the paths
        Throws:
        java.lang.Exception
      • getSrcOutput0

        private java.io.File getSrcOutput0()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getTarget0

        private java.io.File getTarget0()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • getSrc

        @Deprecated
        public java.io.File getSrc()
                            throws java.lang.Exception
        Deprecated.
        This method is deprecated because this can handle only one source dir. Use getSourcePath. For backward compatibility we will return the first entry on the source path.
        Returns:
        first entry on the getSourcePath()
        Throws:
        java.lang.Exception
      • getSrcOutput

        public java.io.File getSrcOutput()
      • getTestSrc

        public java.io.File getTestSrc()
      • getTestOutput

        public java.io.File getTestOutput()
      • getTargetDir

        public java.io.File getTargetDir()
      • traverse

        private void traverse​(java.util.Set<Project> dependencies,
                              Project dependent,
                              java.util.Set<Project> visited)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doPath

        private void doPath​(java.util.Collection<Container> resultpath,
                            java.util.Collection<Project> projects,
                            java.util.Collection<Container> entries,
                            java.util.Collection<Container> bootclasspath,
                            boolean noproject,
                            java.lang.String name)
        Iterate over the entries and place the projects on the projects list and all the files of the entries on the resultpath.
        Parameters:
        resultpath - The list that gets all the files
        projects - The list that gets any projects that are entries
        entries - The input list of classpath entries
      • parseBuildpath

        private java.util.List<Container> parseBuildpath()
                                                  throws java.lang.Exception
        Parse the list of bundles that are a prerequisite to this project. Bundles are listed in repo specific names. So we just let our repo plugins iterate over the list of bundles and we get the highest version from them.
        Throws:
        java.lang.Exception
      • parseRunpath

        private java.util.List<Container> parseRunpath()
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseRunbundles

        private java.util.List<Container> parseRunbundles()
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseRunFw

        private java.util.List<Container> parseRunFw()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseTestpath

        private java.util.List<Container> parseTestpath()
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getBundles

        public java.util.List<Container> getBundles​(Strategy strategyx,
                                                    java.lang.String spec,
                                                    java.lang.String source)
                                             throws java.lang.Exception
        Analyze the header and return a list of files that should be on the build, test or some other path. The list is assumed to be a list of bsns with a version specification. The special case of version=project indicates there is a project in the same workspace. The path to the output directory is calculated. The default directory ${bin} can be overridden with the output attribute.
        Parameters:
        strategyx - STRATEGY_LOWEST or STRATEGY_HIGHEST
        spec - The header
        Throws:
        java.lang.Exception
      • getBundles

        java.util.Collection<Container> getBundles​(Strategy strategy,
                                                   java.lang.String spec)
                                            throws java.lang.Exception
        Just calls a new method with a default parm.
        Throws:
        java.lang.Exception
      • getBundlesWildcard

        public java.util.List<Container> getBundlesWildcard​(java.lang.String bsnPattern,
                                                            java.lang.String range,
                                                            Strategy strategyx,
                                                            java.util.Map<java.lang.String,​java.lang.String> attrs)
                                                     throws java.lang.Exception
        Get all bundles matching a wildcard expression.
        Parameters:
        bsnPattern - A bsn wildcard, e.g. "osgi*" or just "*".
        range - A range to narrow the versions of bundles found, or null to return any version.
        strategyx - The version selection strategy, which may be 'HIGHEST' or 'LOWEST' only -- 'EXACT' is not permitted.
        attrs - Additional search attributes.
        Throws:
        java.lang.Exception
      • mergeNames

        static void mergeNames​(java.lang.String names,
                               java.util.Set<java.lang.String> set)
      • flatten

        static java.lang.String flatten​(java.util.Set<java.lang.String> names)
      • addToPackageList

        static void addToPackageList​(Container container,
                                     java.lang.String newPackageNames)
      • doMavenPom

        public void doMavenPom​(Strategy strategyx,
                               java.util.List<Container> result,
                               java.lang.String action)
                        throws java.lang.Exception
        The user selected pom in a path. This will place the pom as well as its dependencies on the list
        Parameters:
        strategyx - the strategy to use.
        result - The list of result containers
        Throws:
        java.lang.Exception - anything goes wrong
      • getDependson

        public java.util.Collection<Project> getDependson()
                                                   throws java.lang.Exception
        Return the full transitive dependencies of this project.
        Returns:
        A set of the full transitive dependencies of this project.
        Throws:
        java.lang.Exception
      • getBuildDependencies

        public java.util.Set<Project> getBuildDependencies()
                                                    throws java.lang.Exception
        Return the direct build dependencies of this project.
        Returns:
        A set of the direct build dependencies of this project.
        Throws:
        java.lang.Exception
      • getTestDependencies

        public java.util.Set<Project> getTestDependencies()
                                                   throws java.lang.Exception
        Return the direct test dependencies of this project.

        The result includes the direct build dependencies of this project as well, so the result is a super set of getBuildDependencies().

        Returns:
        A set of the test build dependencies of this project.
        Throws:
        java.lang.Exception
      • getDependents

        public java.util.Set<Project> getDependents()
                                             throws java.lang.Exception
        Return the full transitive dependents of this project.

        The result includes projects which have build and test dependencies on this project.

        Since the full transitive dependents of this project is updated during the computation of other project dependencies, until all projects are prepared, the dependents result may be partial.

        Returns:
        A set of the transitive set of projects which depend on this project.
        Throws:
        java.lang.Exception
      • getBuildpath

        public java.util.Collection<Container> getBuildpath()
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTestpath

        public java.util.Collection<Container> getTestpath()
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • justInTime

        private void justInTime​(java.util.Collection<Container> path,
                                java.util.List<Container> entries,
                                boolean noproject,
                                java.lang.String name)
        Handle dependencies for paths that are calculated on demand.
        Parameters:
        testpath2 -
        parseTestpath -
      • getRunpath

        public java.util.Collection<Container> getRunpath()
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getRunbundles

        public java.util.Collection<Container> getRunbundles()
                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getRunFw

        public java.util.Collection<Container> getRunFw()
                                                 throws java.lang.Exception
        Return the run framework
        Throws:
        java.lang.Exception
      • getRunStorage

        public java.io.File getRunStorage()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getRunBuilds

        public boolean getRunBuilds()
      • getSourcePath

        public java.util.Collection<java.io.File> getSourcePath()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getAllsourcepath

        public java.util.Collection<java.io.File> getAllsourcepath()
                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getBootclasspath

        public java.util.Collection<Container> getBootclasspath()
                                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getOutput

        public java.io.File getOutput()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doEclipseClasspath

        private void doEclipseClasspath()
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _p_dependson

        public java.lang.String _p_dependson​(java.lang.String[] args)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • toFiles

        private java.util.Collection<?> toFiles​(java.util.Collection<Project> projects)
      • _p_buildpath

        public java.lang.String _p_buildpath​(java.lang.String[] args)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _p_testpath

        public java.lang.String _p_testpath​(java.lang.String[] args)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _p_sourcepath

        public java.lang.String _p_sourcepath​(java.lang.String[] args)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _p_allsourcepath

        public java.lang.String _p_allsourcepath​(java.lang.String[] args)
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _p_bootclasspath

        public java.lang.String _p_bootclasspath​(java.lang.String[] args)
                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _p_output

        public java.lang.String _p_output​(java.lang.String[] args)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • list

        private java.lang.String list​(java.lang.String[] args,
                                      java.util.Collection<?> list)
      • getMacroDomains

        protected java.lang.Object[] getMacroDomains()
        Description copied from class: Processor
        This should be overridden by subclasses to add extra macro command domains on the search list.
        Overrides:
        getMacroDomains in class Processor
      • release

        public java.io.File release​(java.lang.String jarName,
                                    java.io.InputStream jarStream)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • releaseURI

        public java.net.URI releaseURI​(java.lang.String jarName,
                                       java.io.InputStream jarStream)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • release

        public java.io.File release​(java.lang.String name,
                                    java.lang.String jarName,
                                    java.io.InputStream jarStream)
                             throws java.lang.Exception
        Release
        Parameters:
        name - The repository name
        jarName -
        jarStream -
        Throws:
        java.lang.Exception
      • releaseURI

        public java.net.URI releaseURI​(java.lang.String name,
                                       java.lang.String jarName,
                                       java.io.InputStream jarStream)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • releaseRepo

        private java.net.URI releaseRepo​(RepositoryPlugin releaseRepo,
                                         Processor context,
                                         java.lang.String jarName,
                                         java.io.InputStream jarStream)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getReleaseRepos

        private java.util.List<RepositoryPlugin> getReleaseRepos​(java.lang.String names)
      • parseReleaseRepos

        private Parameters parseReleaseRepos​(java.lang.String names)
      • release

        public void release​(boolean test)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • release

        public void release​(java.lang.String name,
                            boolean test)
                     throws java.lang.Exception
        Release
        Parameters:
        name - The respository name
        test - Run testcases
        Throws:
        java.lang.Exception
      • getBundle

        public Container getBundle​(java.lang.String bsn,
                                   java.lang.String range,
                                   Strategy strategy,
                                   java.util.Map<java.lang.String,​java.lang.String> attrs)
                            throws java.lang.Exception
        Get a bundle from one of the plugin repositories. If an exact version is required we just return the first repository found (in declaration order in the build.bnd file).
        Parameters:
        bsn - The bundle symbolic name
        range - The version range
        strategy - set to LOWEST or HIGHEST
        Returns:
        the file object that points to the bundle or null if not found
        Throws:
        java.lang.Exception - when something goes wrong
      • overrideStrategy

        protected Strategy overrideStrategy​(java.util.Map<java.lang.String,​java.lang.String> attrs,
                                            Strategy useStrategy)
        Parameters:
        attrs -
        useStrategy -
      • parseRepoFilter

        protected Project.RepoFilter parseRepoFilter​(java.util.Map<java.lang.String,​java.lang.String> attrs)
      • toContainer

        protected Container toContainer​(java.lang.String bsn,
                                        java.lang.String range,
                                        java.util.Map<java.lang.String,​java.lang.String> attrs,
                                        java.io.File result,
                                        DownloadBlocker db)
        Parameters:
        bsn -
        range -
        attrs -
        result -
      • getBundleFromProject

        private Container getBundleFromProject​(java.lang.String bsn,
                                               java.util.Map<java.lang.String,​java.lang.String> attrs)
                                        throws java.lang.Exception
        Look for the bundle in the workspace. The premise is that the bsn must start with the project name.
        Parameters:
        bsn - The bsn
        attrs - Any attributes
        Throws:
        java.lang.Exception
      • getBundleByHash

        private Container getBundleByHash​(java.lang.String bsn,
                                          java.util.Map<java.lang.String,​java.lang.String> attrs)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • deploy

        public void deploy​(java.lang.String name,
                           java.io.File file)
                    throws java.lang.Exception
        Deploy the file (which must be a bundle) into the repository.
        Parameters:
        name - The repository name
        file - bundle
        Throws:
        java.lang.Exception
      • deploy

        public void deploy​(java.io.File file)
                    throws java.lang.Exception
        Deploy the file (which must be a bundle) into the repository.
        Parameters:
        file - bundle
        Throws:
        java.lang.Exception
      • deploy

        public void deploy()
                    throws java.lang.Exception
        Deploy the current project to a repository
        Throws:
        java.lang.Exception
      • _repo

        public java.lang.String _repo​(java.lang.String[] args)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • add

        private void add​(java.util.List<java.lang.String> paths,
                         Container container)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getTarget

        public java.io.File getTarget()
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • build

        public java.io.File[] build​(boolean underTest)
                             throws java.lang.Exception
        This is the external method that will pre-build any dependencies if it is out of date.
        Parameters:
        underTest -
        Throws:
        java.lang.Exception
      • install

        private void install​(java.io.File[] files)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getInstallRepositories

        public Parameters getInstallRepositories()
      • install

        private void install​(RepositoryPlugin repo,
                             Processor context,
                             java.io.File f,
                             Attrs value)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getFiles

        public java.io.File[] getFiles()
        Return the files
      • isStale

        public boolean isStale()
                        throws java.lang.Exception
        Check if this project needs building. This is defined as:
        Throws:
        java.lang.Exception
      • isStale

        boolean isStale​(java.util.Set<Project> visited)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getBuildFiles

        public java.io.File[] getBuildFiles()
                                     throws java.lang.Exception
        This method must only be called when it is sure that the project has been build before in the same session. It is a bit yucky, but ant creates different class spaces which makes it hard to detect we already build it. This method remembers the files in the appropriate instance vars.
        Throws:
        java.lang.Exception
      • getBuildFiles

        public java.io.File[] getBuildFiles​(boolean buildIfAbsent)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • buildLocal

        public java.io.File[] buildLocal​(boolean underTest)
                                  throws java.lang.Exception
        Build without doing any dependency checking. Make sure any dependent projects are built first.
        Parameters:
        underTest -
        Throws:
        java.lang.Exception
      • isNoBundles

        public boolean isNoBundles()
        Answer if this project does not have any output
      • saveBuild

        public java.io.File saveBuild​(Jar jar)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getOutputFile

        public java.io.File getOutputFile​(java.lang.String bsn,
                                          java.lang.String version)
                                   throws java.lang.Exception
        Calculate the file for a JAR. The default name is bsn.jar, but this can be overridden with an
        Throws:
        java.lang.Exception
      • getOutputFile

        public java.io.File getOutputFile​(java.lang.String bsn)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • reportNewer

        private void reportNewer​(long lastModified,
                                 Jar jar)
      • refresh

        public boolean refresh()
        Refresh if we are based on stale data. This also implies our workspace.
        Overrides:
        refresh in class Processor
      • isCnf

        public boolean isCnf()
      • getName

        public java.lang.String getName()
      • getActions

        public java.util.Map<java.lang.String,​Action> getActions()
      • fillActions

        public void fillActions​(java.util.Map<java.lang.String,​Action> all)
      • release

        public void release()
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • export

        public java.util.Map.Entry<java.lang.String,​Resource> export​(java.lang.String type,
                                                                           java.util.Map<java.lang.String,​java.lang.String> options)
                                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getExporter

        private Exporter getExporter​(java.lang.String type)
      • export

        public void export​(java.lang.String runFilePath,
                           boolean keep,
                           java.io.File output)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • exportRunbundles

        public void exportRunbundles​(java.lang.String runFilePath,
                                     java.io.File outputDir)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
        Since:
        2.4
      • release

        public void release​(java.lang.String name)
                     throws java.lang.Exception
        Release.
        Parameters:
        name - The repository name
        Throws:
        java.lang.Exception
      • clean

        public void clean()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • clean

        void clean​(java.io.File dir,
                   java.lang.String type)
            throws java.io.IOException
        Throws:
        java.io.IOException
      • build

        public java.io.File[] build()
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getMakefile

        private Makefile getMakefile()
      • run

        public void run()
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isRunTrace

        public boolean isRunTrace()
      • runLocal

        public void runLocal()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • test

        public void test()
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • test

        public void test​(java.util.List<java.lang.String> tests)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • test

        public void test​(java.io.File reportDir,
                         java.util.List<java.lang.String> tests)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • junit

        public void junit()
                   throws java.lang.Exception
        Run JUnit
        Throws:
        java.lang.Exception
      • getValidJar

        public Jar getValidJar​(java.io.File f)
                        throws java.lang.Exception
        This methods attempts to turn any jar into a valid jar. If this is a bundle with manifest, a manifest is added based on defaults. If it is a bundle, but not r4, we try to add the r4 headers.
        Throws:
        java.lang.Exception
      • getValidJar

        public Jar getValidJar​(java.net.URL url)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getValidJar

        public Jar getValidJar​(Jar jar,
                               java.lang.String id)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _project

        public java.lang.String _project​(java.lang.String[] args)
      • bump

        public void bump​(java.lang.String mask)
                  throws java.lang.Exception
        Bump the version of this project. First check the main bnd file. If this does not contain a version, check the include files. If they still do not contain a version, then check ALL the sub builders. If not, add a version to the main bnd file.
        Parameters:
        mask - the mask for bumping, see Macro._version(String[])
        Throws:
        java.lang.Exception
      • replace

        boolean replace​(java.io.File f,
                        java.lang.String pattern,
                        java.lang.String replacement)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • bump

        public void bump()
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • action

        public void action​(java.lang.String command)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • action

        public void action​(java.lang.String command,
                           java.lang.Object... args)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • before

        void before​(Project p,
                    java.lang.String a)
        Run all before command plugins
      • after

        void after​(Project p,
                   java.lang.String a,
                   java.lang.Throwable t)
        Run all after command plugins
      • refreshAll

        public void refreshAll()
      • script

        public void script​(java.lang.String type,
                           java.lang.String script)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • script

        public void script​(java.lang.String type,
                           java.lang.String script,
                           java.lang.Object... args)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _repos

        public java.lang.String _repos​(java.lang.String[] args)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _help

        public java.lang.String _help​(java.lang.String[] args)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getDeliverables

        public java.util.Collection<Container> getDeliverables()
                                                        throws java.lang.Exception
        Returns containers for the deliverables of this project. The deliverables is the project builder for this project if no -sub is specified. Otherwise it contains all the sub bnd files.
        Returns:
        A collection of containers
        Throws:
        java.lang.Exception
      • getSubBuilder

        public Builder getSubBuilder​(java.io.File bndFile)
                              throws java.lang.Exception
        Return a builder associated with the give bnd file or null. The bnd.bnd file can contain -sub option. This option allows specifying files in the same directory that should drive the generation of multiple deliverables. This method figures out if the bndFile is actually one of the bnd files of a deliverable.
        Parameters:
        bndFile - A file pointing to a bnd file.
        Returns:
        null or a builder for a sub file, the caller must close this builder
        Throws:
        java.lang.Exception
      • getSubBuilder

        public ProjectBuilder getSubBuilder​(java.lang.String string)
                                     throws java.lang.Exception
        Return a build that maps to the sub file.
        Parameters:
        string -
        Throws:
        java.lang.Exception
      • getDeliverable

        public Container getDeliverable​(java.lang.String bsn,
                                        java.util.Map<java.lang.String,​java.lang.String> attrs)
                                 throws java.lang.Exception
        Answer the container associated with a given bsn.
        Throws:
        java.lang.Exception
      • getSubBuilders

        @Deprecated
        public java.util.Collection<? extends Builder> getSubBuilders()
                                                               throws java.lang.Exception
        Deprecated.
        As of 3.4. Replace with
                     try (ProjectBuilder pb = getBuilder(null)) {
                        for (Builder b : pb.getSubBuilders()) {
                                ...
                        }
                     }
                     
        Get a list of the sub builders. A bnd.bnd file can contain the -sub option. This will generate multiple deliverables. This method returns the builders for each sub file. If no -sub option is present, the list will contain a builder for the bnd.bnd file.
        Returns:
        A list of builders.
        Throws:
        java.lang.Exception
      • toFile

        java.util.Collection<java.io.File> toFile​(java.util.Collection<Container> containers)
                                           throws java.lang.Exception
        Calculate the classpath. We include our own runtime.jar which includes the test framework and we include the first of the test frameworks specified.
        Throws:
        java.lang.Exception
      • getRunVM

        public java.util.Collection<java.lang.String> getRunVM()
      • getRunProgramArgs

        public java.util.Collection<java.lang.String> getRunProgramArgs()
      • getRunProperties

        public java.util.Map<java.lang.String,​java.lang.String> getRunProperties()
      • getProjectLauncher

        public ProjectLauncher getProjectLauncher()
                                           throws java.lang.Exception
        Get a launcher.
        Throws:
        java.lang.Exception
      • getProjectTester

        public ProjectTester getProjectTester()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getHandler

        private <T> T getHandler​(java.lang.Class<T> target,
                                 java.util.Collection<Container> containers,
                                 java.lang.String header,
                                 java.lang.String defaultHandler)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setDelayRunDependencies

        public void setDelayRunDependencies​(boolean x)
        Make this project delay the calculation of the run dependencies. The run dependencies calculation can be done in prepare or until the dependencies are actually needed.
      • addClasspath

        public void addClasspath​(java.io.File f)
        bnd maintains a class path that is set by the environment, i.e. bnd is not in charge of it.
      • clearClasspath

        public void clearClasspath()
      • getClasspath

        public java.util.Collection<Container> getClasspath()
      • pack

        public Jar pack​(java.lang.String profile)
                 throws java.lang.Exception
        Caller must close this JAR
        Parameters:
        profile -
        Returns:
        a jar with the executable code
        Throws:
        java.lang.Exception
      • baseline

        public void baseline()
                      throws java.lang.Exception
        Do a baseline for this project
        Throws:
        java.lang.Exception
      • verifyDependencies

        public void verifyDependencies​(boolean test)
                                throws java.lang.Exception
        Method to verify that the paths are correct, ie no missing dependencies
        Parameters:
        test - for test cases, also adds -testpath
        Throws:
        java.lang.Exception
      • verifyDependencies

        private void verifyDependencies​(java.lang.String title,
                                        java.util.Collection<Container> path)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • report

        public void report​(java.util.Map<java.lang.String,​java.lang.Object> table)
                    throws java.lang.Exception
        Report detailed info from this project
        Overrides:
        report in class Processor
        Throws:
        java.lang.Exception
      • report

        protected void report​(java.util.Map<java.lang.String,​java.lang.Object> table,
                              boolean isProject)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • compile

        public void compile​(boolean test)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • compile

        private void compile​(Command javac,
                             java.lang.String what)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getCommonJavac

        private Command getCommonJavac​(boolean test)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _ide

        public java.lang.String _ide​(java.lang.String[] args)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getVersions

        public java.util.Map<java.lang.String,​Version> getVersions()
                                                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getBsns

        public java.util.Collection<java.lang.String> getBsns()
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getVersion

        public Version getVersion​(java.lang.String bsn)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getExports

        public Packages getExports()
        Get the exported packages form all builders calculated from the last build
      • getImports

        public Packages getImports()
        Get the imported packages from all builders calculated from the last build
      • getContained

        public Packages getContained()
        Get the contained packages calculated from all builders from the last build
      • remove

        public void remove()
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getRunKeep

        public boolean getRunKeep()
      • setPackageInfo

        public void setPackageInfo​(java.lang.String packageName,
                                   Version newVersion)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getPackageInfo

        public Version getPackageInfo​(java.lang.String packageName)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • preRelease

        public void preRelease()
        Actions to perform before a full workspace release. This is executed for projects that describe the distribution
      • postRelease

        public void postRelease()
        Actions to perform after a full workspace release. This is executed for projects that describe the distribution
      • copy

        public void copy​(RepositoryPlugin source,
                         java.lang.String filter,
                         RepositoryPlugin destination)
                  throws java.lang.Exception
        Copy a repository to another repository
        Throws:
        java.lang.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
      • getSpecification

        public RunSpecification getSpecification()
        Return a basic type only specification of the run aspect of this project
      • getRunSystemPackages

        public Parameters getRunSystemPackages()
      • getRunSystemCapabilities

        public Parameters getRunSystemCapabilities()
      • preBuildChecks

        protected void preBuildChecks()
        Check prebuild things.
      • getBundle

        public Container getBundle​(org.osgi.resource.Resource r)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isStandalone

        public boolean isStandalone()