aQute.bnd.build
Class Project

java.lang.Object
  extended by aQute.bnd.osgi.Domain
      extended by aQute.bnd.osgi.Processor
          extended by aQute.bnd.build.Project
All Implemented Interfaces:
Constants, Registry, Report, Reporter, Closeable, Iterable<String>
Direct Known Subclasses:
Run

public class Project
extends Processor

This class is NOT threadsafe


Nested Class Summary
 
Nested classes/interfaces inherited from class aQute.bnd.osgi.Processor
Processor.CL, Processor.FileLine
 
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
 
Nested classes/interfaces inherited from interface aQute.service.reporter.Report
Report.Location
 
Field Summary
static String BNDCNF
           
static String BNDFILE
           
 
Fields inherited from class aQute.bnd.osgi.Processor
LIST_SPLITTER
 
Fields inherited from interface aQute.bnd.osgi.Constants
BASELINE, BASELINEREPO, BLUEPRINT_TIMEOUT_ATTRIBUTE, BLUEPRINT_WAIT_FOR_DEPENDENCIES_ATTRIBUTE, BND_ADDXMLTOTEST, BND_LASTMODIFIED, BNDDRIVER, BNDDRIVER_ANT, BNDDRIVER_BND, BNDDRIVER_ECLIPSE, BNDDRIVER_GRADLE, BNDDRIVER_GRADLE_NATIVE, BNDDRIVER_INTELLIJ, BNDDRIVER_MAVEN, BNDDRIVER_OSMORC, BNDDRIVER_SBT, BUILDFILES, BUILDPACKAGES, BUILDPATH, BUMPPOLICY, BUNDLE_ACTIVATIONPOLICY, BUNDLE_ACTIVATOR, BUNDLE_BLUEPRINT, BUNDLE_CATEGORY, BUNDLE_CLASSPATH, BUNDLE_CONTACTADDRESS, BUNDLE_CONTRIBUTORS, BUNDLE_COPYRIGHT, BUNDLE_DESCRIPTION, BUNDLE_DEVELOPERS, BUNDLE_DOCURL, BUNDLE_ICON, BUNDLE_LICENSE, BUNDLE_LOCALIZATION, BUNDLE_MANIFESTVERSION, BUNDLE_NAME, BUNDLE_NATIVECODE, BUNDLE_REQUIREDEXECUTIONENVIRONMENT, BUNDLE_SPECIFIC_HEADERS, BUNDLE_SYMBOLIC_NAME_ATTRIBUTE, BUNDLE_SYMBOLICNAME, BUNDLE_UPDATELOCATION, BUNDLE_VENDOR, BUNDLE_VERSION, BUNDLE_VERSION_ATTRIBUTE, CACHEDIR, CLASSPATH, COMMAND_DIRECTIVE, COMPILER_SOURCE, COMPILER_TARGET, COMPONENT_ACTIVATE, COMPONENT_CONFIGURATION_POLICY, COMPONENT_DEACTIVATE, COMPONENT_DESCRIPTORS, COMPONENT_DESIGNATE, COMPONENT_DESIGNATEFACTORY, COMPONENT_DYNAMIC, COMPONENT_ENABLED, COMPONENT_FACTORY, COMPONENT_GREEDY, COMPONENT_IMMEDIATE, COMPONENT_IMPLEMENTATION, COMPONENT_MODIFIED, COMPONENT_MULTIPLE, COMPONENT_NAME, COMPONENT_NAMESPACE, COMPONENT_OPTIONAL, COMPONENT_PROPERTIES, COMPONENT_PROVIDE, COMPONENT_SERVICEFACTORY, COMPONENT_VERSION, componentDirectives, CONDITIONAL_PACKAGE, CONDITIONALPACKAGE, CONDUIT, CONSUMER_POLICY, CONTRACT, CREATED_BY, CURRENT_PACKAGE, CURRENT_USES, CURRENT_VERSION, DEBUG, DEFAULT_BAR_EXTENSION, DEFAULT_BND_EXTENSION, DEFAULT_BNDRUN_EXTENSION, DEFAULT_CHARSET, DEFAULT_DO_NOT_COPY, DEFAULT_JAR_EXTENSION, DEFAULT_LAUNCHER_BSN, DEFAULT_PREPROCESSS_MATCHERS, DEFAULT_PROP_BIN_DIR, DEFAULT_PROP_SRC_DIR, DEFAULT_PROP_TARGET_DIR, DEFAULT_PROP_TESTBIN_DIR, DEFAULT_PROP_TESTSRC_DIR, DEFAULT_TESTER_BSN, DEPENDSON, DEPLOY, DEPLOYREPO, DESCRIPTION_ATTRIBUTE, DIFFIGNORE, DIGESTS, directives, DONOTCOPY, DSANNOTATIONS, DUPLICATE_MARKER, DYNAMICIMPORT_PACKAGE, EEPROFILE, EEPROFILE_AUTO_ATTRIBUTE, EFFECTIVE_DIRECTIVE, EMBEDDED_REPO, EMPTY, EMPTY_HEADER, EXCLUDE_DIRECTIVE, EXPERIMENTS, EXPORT, EXPORT_CONTENTS, EXPORT_PACKAGE, EXPORT_SERVICE, EXTENSION, EXTENSION_DIRECTIVE, FAIL_OK, FILTER_DIRECTIVE, FIXUPMESSAGES, FIXUPMESSAGES_IS_DIRECTIVE, FIXUPMESSAGES_IS_ERROR, FIXUPMESSAGES_IS_IGNORE, FIXUPMESSAGES_IS_WARNING, FIXUPMESSAGES_REPLACE_DIRECTIVE, FIXUPMESSAGES_RESTRICT_DIRECTIVE, FRAGMENT_ATTACHMENT_DIRECTIVE, FRAGMENT_HOST, FROM_DIRECTIVE, GESTALT, GESTALT_BATCH, GESTALT_CI, GESTALT_INTERACTIVE, GESTALT_OFFLINE, GESTALT_SHELL, headers, IGNORE_PACKAGE, IMPORT_DIRECTIVE, IMPORT_PACKAGE, IMPORT_PRIVATE, IMPORT_REFERENCE, IMPORT_SERVICE, importDirectives, INCLUDE, INCLUDE_DIRECTIVE, INCLUDE_RESOURCE, INCLUDERESOURCE, INVALIDFILENAMES, JAVAAGENT, JIDENTIFIER, KEYSTORE_LOCATION_DIRECTIVE, KEYSTORE_PASSWORD_DIRECTIVE, KEYSTORE_PROVIDER_DIRECTIVE, LANGUAGE_ATTRIBUTE, LAUNCHER_PLUGIN, LIB_DIRECTIVE, LINK_ATTRIBUTE, LITERAL_ATTRIBUTE, MAKE, MANDATORY_DIRECTIVE, MANIFEST, MANIFEST_NAME, META_PERSISTENCE, METAPACKAGES, METATYPE, METATYPE_ANNOTATIONS, NAME_ATTRIBUTE, NAMESECTION, NAMESPACE_STEM, NO_IMPORT_DIRECTIVE, NOANNOTATIONS, NOBUILDINCACHE, NOBUNDLES, NODEFAULTVERSION, NOEE, NOEXTRAHEADERS, NOJUNIT, NOJUNITOSGI, NOMANIFEST, NONE, NOUSES, options, OSNAME_ATTRIBUTE, OSVERSION_ATTRIBUTE, OUTPUT, OUTPUTMASK, PACKAGE, PACKAGE_JPM, PATH_DIRECTIVE, PEDANTIC, PLUGIN, PLUGINPATH, PLUGINPATH_SHA1_ATTR, PLUGINPATH_URL_ATTR, POM, PREPROCESSMATCHERS, PRESENCE_DIRECTIVE, PRIVATE_DIRECTIVE, PRIVATE_PACKAGE, PRIVATEPACKAGE, PROCESSOR_ATTRIBUTE, PROFILE, PROVIDE_CAPABILITY, PROVIDE_DIRECTIVE, PROVIDER_POLICY, PROVIDER_TYPE_DIRECTIVE, RELEASEREPO, REMOVE_ATTRIBUTE_DIRECTIVE, REMOVEHEADERS, REPORTNEWER, REPOSITORIES, REQUIRE_BND, REQUIRE_BUNDLE, REQUIRE_CAPABILITY, RESOLUTION_DIRECTIVE, RESOLVE, RESOURCEONLY, RUNBLACKLIST, RUNBUILDS, RUNBUNDLES, RUNEE, RUNENV, RUNFRAMEWORK, RUNFRAMEWORK_NONE, RUNFRAMEWORK_SERVICES, RUNFW, RUNJDB, RUNNOREFERENCES, RUNPATH, RUNPATH_LAUNCHER_DIRECTIVE, RUNPATH_MAIN_DIRECTIVE, RUNPROGRAMARGS, RUNPROPERTIES, RUNREPOS, RUNREQUIRE, RUNREQUIRES, RUNSTORAGE, RUNSYSTEMCAPABILITIES, RUNSYSTEMPACKAGES, RUNTIMEOUT, RUNTRACE, RUNVM, SAVEMANIFEST, SELECTION_FILTER_ATTRIBUTE, SERVICE_COMPONENT, SET_COMPONENT_DIRECTIVES, SET_COMPONENT_DIRECTIVES_1_1, SET_COMPONENT_DIRECTIVES_1_2, SIGN, SIGN_PASSWORD_DIRECTIVE, SIGNATURE_TEST, SINGLETON_DIRECTIVE, SIZE_ATTRIBUTE, SNAPSHOT, SOURCEPATH, SOURCES, SPECIFICATION_VERSION, SPLIT_PACKAGE_DIRECTIVE, STRICT, SUB, SYSTEMPROPERTIES, TESTCASES, TESTCONTINUOUS, TESTER_PLUGIN, TESTPACKAGES, TESTPATH, TESTREPORT, TESTSOURCES, TESTSUITES, TESTUNRESOLVED, TOOL, UNDERTEST, UPTO, USES_DIRECTIVE, USES_USES, VALID_PROPERTY_TYPES, VERBOSE, VERSION_ATTR_LATEST, VERSION_ATTR_PROJECT, VERSION_ATTR_SNAPSHOT, VERSION_ATTRIBUTE, VERSION_FILTER, VISIBILITY_DIRECTIVE, WAB, WABLIB
 
Constructor Summary
Project(Workspace workspace, File buildDir)
           
Project(Workspace workspace, File projectDir, File buildFile)
           
 
Method Summary
 String _findfile(String[] args)
           
 String _help(String[] args)
           
 String _ide(String[] args)
           
 String _p_allsourcepath(String[] args)
           
 String _p_bootclasspath(String[] args)
           
 String _p_buildpath(String[] args)
           
 String _p_dependson(String[] args)
           
 String _p_output(String[] args)
           
 String _p_sourcepath(String[] args)
           
 String _p_testpath(String[] args)
           
 String _project(String[] args)
           
 String _repo(String[] args)
           
 String _repos(String[] args)
           
 void action(String command)
           
 void action(String command, Object... args)
           
 void addClasspath(File f)
          bnd maintains a class path that is set by the environment, i.e.
 void baseline()
          Do a baseline for this project
 File[] build()
           
 File[] build(boolean underTest)
          This is the external method that will pre-build any dependencies if it is out of date.
 File[] buildLocal(boolean underTest)
          Build without doing any dependency checking.
 void bump()
           
 void bump(String mask)
          Bump the version of this project.
 void clean()
           
 void clearClasspath()
           
 void compile(boolean test)
           
 void deploy()
          Deploy the current project to a repository
 void deploy(File file)
          Deploy the file (which must be a bundle) into the repository.
 void deploy(String name, File file)
          Deploy the file (which must be a bundle) into the repository.
 void doMavenPom(Strategy strategyx, List<Container> result, String action)
          The user selected pom in a path.
 void export(String runFilePath, boolean keep, File output)
           
 void exportRunbundles(String runFilePath, File outputDir)
           
 void fillActions(Map<String,Action> all)
           
 Map<String,Action> getActions()
           
 Collection<File> getAllsourcepath()
           
 Collection<Container> getBootclasspath()
           
 Collection<String> getBsns()
           
 ProjectBuilder getBuilder(ProjectBuilder parent)
          Return a new builder that is nicely setup for this project.
 File[] getBuildFiles()
          This method must only be called when it is sure that the project has been build before in the same session.
 File[] getBuildFiles(boolean buildIfAbsent)
           
 Collection<Container> getBuildpath()
           
 Container getBundle(String bsn, String range, Strategy strategy, Map<String,String> attrs)
          Get a bundle from one of the plugin repositories.
 List<Container> getBundles(Strategy strategyx, String spec, String source)
          Analyze the header and return a list of files that should be on the build, test or some other path.
 int getChanged()
           
 Collection<Container> getClasspath()
           
 Packages getContained()
          Get the contained packages calculated from all builders from the last build
 Container getDeliverable(String bsn, Map<String,String> attrs)
          Answer the container associated with a given bsn.
 Collection<Container> getDeliverables()
          Returns containers for the deliverables of this project.
 Collection<Project> getDependson()
           
 Packages getExports()
          Get the exported packages form all builders calculated from the last build
 File[] getFiles()
          Return the files
 Packages getImports()
          Get the imported packages from all builders calculated from the last build
protected  Object[] getMacroDomains()
          This should be overridden by subclasses to add extra macro command domains on the search list.
 String getName()
           
 File getOutput()
           
 File getOutputFile(String bsn)
           
 File getOutputFile(String bsn, String version)
          Calculate the file for a JAR.
 Version getPackageInfo(String packageName)
           
 ProjectLauncher getProjectLauncher()
          Get a launcher.
 ProjectTester getProjectTester()
           
 boolean getRunBuilds()
           
 Collection<Container> getRunbundles()
           
 Collection<Container> getRunFw()
          Return the run framework
 Collection<Container> getRunpath()
           
 Collection<String> getRunProgramArgs()
           
 Map<String,String> getRunProperties()
           
 File getRunStorage()
           
 Collection<String> getRunVM()
           
 Collection<File> getSourcePath()
           
 File getSrc()
           
 File getSrcOutput()
           
 Builder getSubBuilder(File bndFile)
          Return the builder associated with the give bnd file or null.
 ProjectBuilder getSubBuilder(String string)
          Return a build that maps to the sub file.
 Collection<? extends Builder> getSubBuilders()
          Get a list of the sub builders.
 File getTarget()
           
 File getTargetDir()
           
 File getTestOutput()
           
 Collection<Container> getTestpath()
           
 File getTestSrc()
           
static Project getUnparented(File propertiesFile)
           
 Jar getValidJar(File f)
          This methods attempts to turn any jar into a valid jar.
 Jar getValidJar(Jar jar, String id)
           
 Jar getValidJar(URL url)
           
 Version getVersion(String bsn)
           
 Map<String,Version> getVersions()
           
 Workspace getWorkspace()
           
 boolean isCnf()
           
 boolean isNoBundles()
          Answer if this project does not have any output
 boolean isStale()
          Check if this project needs building.
 boolean isValid()
           
 void junit()
          Run JUnit
protected  Strategy overrideStrategy(Map<String,String> attrs, Strategy useStrategy)
           
 Jar pack(String profile)
           
 void prepare()
          Set up all the paths
 void propertiesChanged()
           
 boolean refresh()
          Refresh if we are based on stale data.
 void refreshAll()
           
 void release()
           
 void release(boolean test)
           
 void release(String name)
          Release.
 void release(String name, boolean test)
          Release
 File release(String jarName, InputStream jarStream)
           
 File release(String name, String jarName, InputStream jarStream)
          Release
 URI releaseURI(String jarName, InputStream jarStream)
           
 URI releaseURI(String name, String jarName, InputStream jarStream)
           
 void remove()
           
 void report(Map<String,Object> table)
          Report detailed info from this project
protected  void report(Map<String,Object> table, boolean isProject)
           
 void run()
           
 void runLocal()
           
 File saveBuild(Jar jar)
           
 void script(String type, String script)
           
 void script(String type, String script, Object... args)
           
 void setChanged()
           
 void setDelayRunDependencies(boolean x)
          Make this project delay the calculation of the run dependencies.
 void setPackageInfo(String packageName, Version version)
          Sets the package version on an exported package
 void test()
           
 void test(List<String> tests)
           
protected  Container toContainer(String bsn, String range, Map<String,String> attrs, File result, DownloadBlocker db)
           
 String toString()
          Printout of the status of this processor for toString()
 void verifyDependencies(boolean test)
          Method to verify that the paths are correct, ie no missing dependencies
 
Methods inherited from class aQute.bnd.osgi.Processor
_basedir, _native_capability, _propertiesdir, _propertiesname, _random, addBasicPlugin, addClose, addExtensions, addIncluded, addProperties, addProperties, append, appendPath, begin, beginHandleErrors, check, clear, close, concat, customize, doAttrbutes, doIncludeFile, doIncludeFile, endHandleErrors, error, error, exception, exists, findHeader, findHeader, forceRefresh, formatArrays, get, get, getBase, getClass, getDuration, getErrors, getExecutor, getFile, getFile, getFlattenedProperties, getFlattenedProperties, getHeader, getHeader, getIncluded, getInfo, getInfo, getJarFromName, getLine, getLoader, getLocation, getManifestAsProperties, getParent, getPlugin, getPlugins, getPlugins, getProperties, getPropertiesFile, getProperty, getProperty, getProperty, getPropertyKeys, getReplacer, getTop, getUnprocessedProperty, getWarnings, is, isDuplicate, isExceptions, isFailOk, isMissingPlugin, isOk, isPedantic, isPerfect, isTrace, isTrue, iterator, join, join, join, join, join, keySet, lastModified, loadPlugins, loadProperties, makePrintable, merge, mergeProperties, mergeProperties, mergeProperties, mergeProperties, newHashMap, newList, newList, newMap, newMap, newSet, newSet, normalize, normalize, parseHeader, parseHeader, printClause, printClauses, printClauses, printExceptionSummary, printStackTrace, progress, progress, quote, read, removeBasicPlugin, removeClose, removeDuplicateMarker, replaceAll, replaceExtension, report, set, setBase, setExceptions, setFileMustExist, setForceLocal, setParent, setPedantic, setProperties, setProperties, setProperties, setProperty, setTrace, setTypeSpecificPlugins, signal, since, split, split, split, trace, unsetProperty, updateModified, use, warning
 
Methods inherited from class aQute.bnd.osgi.Domain
domain, domain, domain, domain, getBundleActivator, getBundleClasspath, getBundleClassPath, getBundleRequiredExecutionEnvironment, getBundleSymbolicName, getBundleVersion, getDynamicImportPackage, getExportContents, getExportPackage, getFragmentHost, getIcon, getImportPackage, getIncludeResource, getParameters, getParameters, getParameters, getParameters, getPrivatePackage, getProvideCapability, getRequireBundle, getRequireCapability, isSources, setBundleActivator, setBundleClasspath, setBundleRequiredExecutionEnvironment, setBundleSymbolicName, setBundleVersion, setBundleVersion, setConditionalPackage, setExportPackage, setFailOk, setImportPackage, setIncludeResource, setPrivatePackage, setSources, setTranslation, translate, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BNDFILE

public static final String BNDFILE
See Also:
Constant Field Values

BNDCNF

public static final String BNDCNF
See Also:
Constant Field Values
Constructor Detail

Project

public Project(Workspace workspace,
               File projectDir,
               File buildFile)
        throws Exception
Throws:
Exception

Project

public Project(Workspace workspace,
               File buildDir)
        throws Exception
Throws:
Exception
Method Detail

getUnparented

public static Project getUnparented(File propertiesFile)
                             throws Exception
Throws:
Exception

isValid

public boolean isValid()

getBuilder

public ProjectBuilder getBuilder(ProjectBuilder parent)
                          throws 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
Returns:
Throws:
Exception

getChanged

public int getChanged()

setChanged

public void setChanged()

getWorkspace

public Workspace getWorkspace()

toString

public 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 Exception
Set up all the paths

Throws:
Exception

getSrc

public File getSrc()

getSrcOutput

public File getSrcOutput()

getTestSrc

public File getTestSrc()

getTestOutput

public File getTestOutput()

getTargetDir

public File getTargetDir()

getBundles

public List<Container> getBundles(Strategy strategyx,
                                  String spec,
                                  String source)
                           throws 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:
strategy - STRATEGY_LOWEST or STRATEGY_HIGHEST
spec - The header
Returns:
Throws:
Exception

doMavenPom

public void doMavenPom(Strategy strategyx,
                       List<Container> result,
                       String action)
                throws 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
attrs - The attributes
Throws:
Exception - anything goes wrong

getDependson

public Collection<Project> getDependson()
                                 throws Exception
Throws:
Exception

getBuildpath

public Collection<Container> getBuildpath()
                                   throws Exception
Throws:
Exception

getTestpath

public Collection<Container> getTestpath()
                                  throws Exception
Throws:
Exception

getRunpath

public Collection<Container> getRunpath()
                                 throws Exception
Throws:
Exception

getRunbundles

public Collection<Container> getRunbundles()
                                    throws Exception
Throws:
Exception

getRunFw

public Collection<Container> getRunFw()
                               throws Exception
Return the run framework

Throws:
Exception

getRunStorage

public File getRunStorage()
                   throws Exception
Throws:
Exception

getRunBuilds

public boolean getRunBuilds()

getSourcePath

public Collection<File> getSourcePath()
                               throws Exception
Throws:
Exception

getAllsourcepath

public Collection<File> getAllsourcepath()
                                  throws Exception
Throws:
Exception

getBootclasspath

public Collection<Container> getBootclasspath()
                                       throws Exception
Throws:
Exception

getOutput

public File getOutput()
               throws Exception
Throws:
Exception

_p_dependson

public String _p_dependson(String[] args)
                    throws Exception
Throws:
Exception

_p_buildpath

public String _p_buildpath(String[] args)
                    throws Exception
Throws:
Exception

_p_testpath

public String _p_testpath(String[] args)
                   throws Exception
Throws:
Exception

_p_sourcepath

public String _p_sourcepath(String[] args)
                     throws Exception
Throws:
Exception

_p_allsourcepath

public String _p_allsourcepath(String[] args)
                        throws Exception
Throws:
Exception

_p_bootclasspath

public String _p_bootclasspath(String[] args)
                        throws Exception
Throws:
Exception

_p_output

public String _p_output(String[] args)
                 throws Exception
Throws:
Exception

getMacroDomains

protected 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
Returns:

release

public File release(String jarName,
                    InputStream jarStream)
             throws Exception
Throws:
Exception

releaseURI

public URI releaseURI(String jarName,
                      InputStream jarStream)
               throws Exception
Throws:
Exception

release

public File release(String name,
                    String jarName,
                    InputStream jarStream)
             throws Exception
Release

Parameters:
name - The repository name
jarName -
jarStream -
Returns:
Throws:
Exception

releaseURI

public URI releaseURI(String name,
                      String jarName,
                      InputStream jarStream)
               throws Exception
Throws:
Exception

release

public void release(boolean test)
             throws Exception
Throws:
Exception

release

public void release(String name,
                    boolean test)
             throws Exception
Release

Parameters:
name - The respository name
test - Run testcases
Throws:
Exception

getBundle

public Container getBundle(String bsn,
                           String range,
                           Strategy strategy,
                           Map<String,String> attrs)
                    throws 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
lowest - set to LOWEST or HIGHEST
Returns:
the file object that points to the bundle or null if not found
Throws:
Exception - when something goes wrong

overrideStrategy

protected Strategy overrideStrategy(Map<String,String> attrs,
                                    Strategy useStrategy)
Parameters:
attrs -
useStrategy -
Returns:

toContainer

protected Container toContainer(String bsn,
                                String range,
                                Map<String,String> attrs,
                                File result,
                                DownloadBlocker db)
Parameters:
bsn -
range -
attrs -
result -
Returns:

deploy

public void deploy(String name,
                   File file)
            throws Exception
Deploy the file (which must be a bundle) into the repository.

Parameters:
name - The repository name
file - bundle
Throws:
Exception

deploy

public void deploy(File file)
            throws Exception
Deploy the file (which must be a bundle) into the repository.

Parameters:
file - bundle
Throws:
Exception

deploy

public void deploy()
            throws Exception
Deploy the current project to a repository

Throws:
Exception

_repo

public String _repo(String[] args)
             throws Exception
Throws:
Exception

getTarget

public File getTarget()
               throws Exception
Throws:
Exception

build

public File[] build(boolean underTest)
             throws Exception
This is the external method that will pre-build any dependencies if it is out of date.

Parameters:
underTest -
Returns:
Throws:
Exception

getFiles

public File[] getFiles()
Return the files


isStale

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

Throws:
Exception

getBuildFiles

public File[] getBuildFiles()
                     throws 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.

Returns:
Throws:
Exception

getBuildFiles

public File[] getBuildFiles(boolean buildIfAbsent)
                     throws Exception
Throws:
Exception

buildLocal

public File[] buildLocal(boolean underTest)
                  throws Exception
Build without doing any dependency checking. Make sure any dependent projects are built first.

Parameters:
underTest -
Returns:
Throws:
Exception

isNoBundles

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

Returns:

saveBuild

public File saveBuild(Jar jar)
               throws Exception
Throws:
Exception

getOutputFile

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

Parameters:
jar -
Returns:
Throws:
Exception

getOutputFile

public File getOutputFile(String bsn)
                   throws Exception
Throws:
Exception

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()

propertiesChanged

public void propertiesChanged()
Overrides:
propertiesChanged in class Processor

getName

public String getName()

getActions

public Map<String,Action> getActions()

fillActions

public void fillActions(Map<String,Action> all)

release

public void release()
             throws Exception
Throws:
Exception

export

public void export(String runFilePath,
                   boolean keep,
                   File output)
            throws Exception
Throws:
Exception

exportRunbundles

public void exportRunbundles(String runFilePath,
                             File outputDir)
                      throws Exception
Throws:
Exception
Since:
2.4

release

public void release(String name)
             throws Exception
Release.

Parameters:
name - The repository name
Throws:
Exception

clean

public void clean()
           throws Exception
Throws:
Exception

build

public File[] build()
             throws Exception
Throws:
Exception

run

public void run()
         throws Exception
Throws:
Exception

runLocal

public void runLocal()
              throws Exception
Throws:
Exception

test

public void test()
          throws Exception
Throws:
Exception

test

public void test(List<String> tests)
          throws Exception
Throws:
Exception

junit

public void junit()
           throws Exception
Run JUnit

Throws:
Exception

getValidJar

public Jar getValidJar(File f)
                throws 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.

Parameters:
descriptor -
in -
Returns:
Throws:
Exception

getValidJar

public Jar getValidJar(URL url)
                throws Exception
Throws:
Exception

getValidJar

public Jar getValidJar(Jar jar,
                       String id)
                throws Exception
Throws:
Exception

_project

public String _project(String[] args)

bump

public void bump(String mask)
          throws 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:
Exception

bump

public void bump()
          throws Exception
Throws:
Exception

action

public void action(String command)
            throws Exception
Throws:
Exception

action

public void action(String command,
                   Object... args)
            throws Exception
Throws:
Exception

_findfile

public String _findfile(String[] args)

refreshAll

public void refreshAll()

script

public void script(String type,
                   String script)
            throws Exception
Throws:
Exception

script

public void script(String type,
                   String script,
                   Object... args)
            throws Exception
Throws:
Exception

_repos

public String _repos(String[] args)
              throws Exception
Throws:
Exception

_help

public String _help(String[] args)
             throws Exception
Throws:
Exception

getDeliverables

public Collection<Container> getDeliverables()
                                      throws 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:
Exception

getSubBuilder

public Builder getSubBuilder(File bndFile)
                      throws Exception
Return the 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 the builder for a sub file.
Throws:
Exception

getSubBuilder

public ProjectBuilder getSubBuilder(String string)
                             throws Exception
Return a build that maps to the sub file.

Parameters:
string -
Throws:
Exception

getDeliverable

public Container getDeliverable(String bsn,
                                Map<String,String> attrs)
                         throws Exception
Answer the container associated with a given bsn.

Parameters:
bndFile - A file pointing to a bnd file.
Returns:
null or the builder for a sub file.
Throws:
Exception

getSubBuilders

public Collection<? extends Builder> getSubBuilders()
                                             throws Exception
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:
Exception

getRunVM

public Collection<String> getRunVM()

getRunProgramArgs

public Collection<String> getRunProgramArgs()

getRunProperties

public Map<String,String> getRunProperties()

getProjectLauncher

public ProjectLauncher getProjectLauncher()
                                   throws Exception
Get a launcher.

Returns:
Throws:
Exception

getProjectTester

public ProjectTester getProjectTester()
                               throws Exception
Throws:
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.


setPackageInfo

public void setPackageInfo(String packageName,
                           Version version)
Sets the package version on an exported package

Parameters:
packageName - The package name
version - The new package version

getPackageInfo

public Version getPackageInfo(String packageName)
                       throws IOException
Throws:
IOException

addClasspath

public void addClasspath(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 Collection<Container> getClasspath()

pack

public Jar pack(String profile)
         throws Exception
Throws:
Exception

baseline

public void baseline()
              throws Exception
Do a baseline for this project

Throws:
Exception

verifyDependencies

public void verifyDependencies(boolean test)
                        throws Exception
Method to verify that the paths are correct, ie no missing dependencies

Parameters:
test - for test cases, also adds -testpath
Throws:
Exception

report

public void report(Map<String,Object> table)
            throws Exception
Report detailed info from this project

Overrides:
report in class Processor
Throws:
Exception

report

protected void report(Map<String,Object> table,
                      boolean isProject)
               throws Exception
Throws:
Exception

compile

public void compile(boolean test)
             throws Exception
Throws:
Exception

_ide

public String _ide(String[] args)
            throws IOException
Throws:
IOException

getVersions

public Map<String,Version> getVersions()
                                throws Exception
Throws:
Exception

getBsns

public Collection<String> getBsns()
                           throws Exception
Throws:
Exception

getVersion

public Version getVersion(String bsn)
                   throws Exception
Throws:
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 Exception
Throws:
Exception


Copyright © 2014 aQute SARL. All rights reserved.