Package aQute.bnd.build
Class Project
java.lang.Object
aQute.bnd.osgi.Domain
aQute.bnd.osgi.Processor
aQute.bnd.build.Project
- All Implemented Interfaces:
Constants
,Registry
,Report
,Reporter
,Closeable
,AutoCloseable
,Iterable<String>
- Direct Known Subclasses:
Run
This class is NOT threadsafe
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
private static class
Nested classes/interfaces inherited from class aQute.bnd.osgi.Processor
Processor.CL, Processor.FileLine
Nested classes/interfaces inherited from interface aQute.service.reporter.Report
Report.Location
Nested classes/interfaces inherited from interface aQute.service.reporter.Reporter
Reporter.SetLocation
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static String
Macro access to the repository ${repo;[; [;<lowest|highest|exact>]]} (package private) final Collection<File>
static final String
static final String
(package private) static final Path
(package private) final Collection<Container>
(package private) final Collection<Container>
(package private) final Collection<Container>
(package private) final Packages
private Project.RefreshData
(package private) static final String
(package private) boolean
(package private) final Packages
private File[]
private Properties
(package private) final Packages
private static final org.slf4j.Logger
private Makefile
(package private) final ProjectMessages
(package private) File
(package private) final PackageInfo
private final AtomicBoolean
private final AtomicInteger
(package private) final Collection<Container>
(package private) final Collection<Container>
(package private) final Collection<Container>
(package private) File
static final String
(package private) File
(package private) final Collection<Container>
(package private) final Workspace
Fields inherited from class aQute.bnd.osgi.Processor
LIST_SPLITTER, log
Fields inherited from interface aQute.bnd.osgi.Constants
ACCESS_ATTRIBUTE, AUGMENT, AUGMENT_CAPABILITY_DIRECTIVE, AUGMENT_RANGE_ATTRIBUTE, AUGMENT_REQUIREMENT_DIRECTIVE, AUTOMATIC_MODULE_NAME, BASELINE, BASELINEREPO, BLUEPRINT_TIMEOUT_ATTRIBUTE, BLUEPRINT_WAIT_FOR_DEPENDENCIES_ATTRIBUTE, BND_ADDXMLTOTEST, BND_LASTMODIFIED, BND_USE_ATTRIBUTES, BNDDRIVER, BNDDRIVER_ANT, BNDDRIVER_BND, BNDDRIVER_ECLIPSE, BNDDRIVER_GRADLE, BNDDRIVER_GRADLE_NATIVE, BNDDRIVER_INTELLIJ, BNDDRIVER_MAVEN, BNDDRIVER_OSMORC, BNDDRIVER_SBT, BSN_SOURCE_SUFFIX, BUILDERIGNORE, BUILDFILES, BUILDPATH, BUILDREPO, 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_SCM, BUNDLE_SPECIFIC_HEADERS, BUNDLE_SYMBOLIC_NAME_ATTRIBUTE, BUNDLE_SYMBOLICNAME, BUNDLE_UPDATELOCATION, BUNDLE_VENDOR, BUNDLE_VERSION, BUNDLE_VERSION_ATTRIBUTE, BUNDLEANNOTATIONS, CARDINALITY_DIRECTIVE, CDIANNOTATIONS, CHECK, CLASS_ATTRIBUTE, CLASSPATH, COMMAND_DIRECTIVE, COMPONENT_ACTIVATE, COMPONENT_CONFIGURATION_POLICY, COMPONENT_DEACTIVATE, COMPONENT_DESCRIPTORS, COMPONENT_DESIGNATE, COMPONENT_DESIGNATEFACTORY, COMPONENT_DIRECTIVES, COMPONENT_DIRECTIVES_1_1, COMPONENT_DIRECTIVES_1_2, 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, COMPRESSION, CONDITIONAL_PACKAGE, CONDITIONALPACKAGE, CONDUIT, CONNECTION_SETTINGS, CONSUMER_POLICY, CONTRACT, CREATED_BY, CURRENT_BUNDLESYMBOLICNAME, CURRENT_BUNDLEVERSION, CURRENT_PACKAGE, CURRENT_USES, CURRENT_VERSION, 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, DEFINE_CONTRACT, DEPENDSON, DEPLOY, DEPLOYREPO, DESCRIPTION_ATTRIBUTE, DIFFIGNORE, DIFFPACKAGES, DIGESTS, directives, DISTRO, DONOTCOPY, DSANNOTATIONS, DSANNOTATIONS_OPTIONS, DUPLICATE_MARKER, DYNAMICIMPORT_PACKAGE, EE_ATTRIBUTE, EEPROFILE, EEPROFILE_AUTO_ATTRIBUTE, EFFECTIVE_DIRECTIVE, EMBEDDED_REPO, EMPTY_HEADER, EXCLUDE_DIRECTIVE, EXECUTABLE, EXPORT, EXPORT_APIGUARDIAN, EXPORT_BSN, EXPORT_CONTENTS, EXPORT_NAME, EXPORT_PACKAGE, EXPORT_SERVICE, EXPORT_TYPE, EXPORT_VERSION, EXPORTS_ATTRIBUTE, EXPORTTYPE, 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, GENERATE, GESTALT, GESTALT_BATCH, GESTALT_CI, GESTALT_INTERACTIVE, GESTALT_OFFLINE, GESTALT_SHELL, GROUPID, headers, IDENTITY_INITIAL_RESOURCE, IDENTITY_SYSTEM_RESOURCE, IGNORE_ATTRIBUTE, IGNORE_PACKAGE, IGNORE_STANDALONE, IMPORT_DIRECTIVE, IMPORT_PACKAGE, IMPORT_PRIVATE, IMPORT_REFERENCE, IMPORT_SERVICE, importDirectives, INCLUDE, INCLUDE_DIRECTIVE, INCLUDE_RESOURCE, INCLUDEPACKAGE, INCLUDERESOURCE, INIT, INTERNAL_BUNDLESYMBOLICNAME_DIRECTIVE, INTERNAL_BUNDLEVERSION_DIRECTIVE, INTERNAL_EXPORT_TO_MODULES_DIRECTIVE, INTERNAL_EXPORTED_DIRECTIVE, INTERNAL_MODULE_DIRECTIVE, INTERNAL_MODULE_VERSION_DIRECTIVE, INTERNAL_OPEN_TO_MODULES_DIRECTIVE, INTERNAL_PREFIX, INTERNAL_SOURCE_DIRECTIVE, INVALIDFILENAMES, JAVA, JAVA_DEBUG, JAVAAGENT, JAVAC, JAVAC_ENCODING, JAVAC_PROFILE, JAVAC_SOURCE, JAVAC_TARGET, JIDENTIFIER, JPMS_MODULE_INFO, JPMS_MODULE_INFO_OPTIONS, KEYSTORE_LOCATION_DIRECTIVE, KEYSTORE_PASSWORD_DIRECTIVE, KEYSTORE_PROVIDER_DIRECTIVE, LANGUAGE_ATTRIBUTE, LAUNCH_ACTIVATION_EAGER, LAUNCH_ACTIVATORS, LAUNCH_RUNBUNDLES_ATTRS, LAUNCH_STARTLEVEL_DEFAULT, LAUNCH_TRACE, LAUNCHER_PLUGIN, LIB_DIRECTIVE, LIBRARY, LINK_ATTRIBUTE, LITERAL_ATTRIBUTE, MAIN_CLASS, MAKE, MANDATORY_DIRECTIVE, MANIFEST, MANIFEST_NAME, MAVEN_DEPENDENCIES, MAVEN_RELEASE, MAVEN_SCOPE, META_PERSISTENCE, METAPACKAGES, METATYPE, METATYPE_ANNOTATIONS, METATYPE_ANNOTATIONS_OPTIONS, MIME_TYPE_BUNDLE, MIME_TYPE_JAR, MODULE_INFO_CLASS, MODULES_ATTRIBUTE, NAME_ATTRIBUTE, NAMESECTION, NAMESPACE_STEM, NO_IMPORT_DIRECTIVE, NOANNOTATIONS, NOBUILDINCACHE, NOBUNDLES, NOCLASSFORNAME, NODEFAULTVERSION, NOEE, NOEXTRAHEADERS, NOIMPORTJAVA, NOJUNIT, NOJUNITOSGI, NOMANIFEST, NONE, NOT_A_BUNDLE_S, NOUSES, OPTIONAL, options, OSGI_SYNTAX_HEADERS, OSNAME_ATTRIBUTE, OSVERSION_ATTRIBUTE, OUTPUT, OUTPUTMASK, PACKAGEINFOTYPE, 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, REMOTEWORKSPACE, REMOVE_ATTRIBUTE_DIRECTIVE, REMOVEHEADERS, REPORTNEWER, REPOSITORIES, REPRODUCIBLE, REQUIRE_BND, REQUIRE_BUNDLE, REQUIRE_CAPABILITY, RESOLUTION, RESOLUTION_DIRECTIVE, RESOLUTION_DYNAMIC, RESOLVE, RESOLVE_EFFECTIVE, RESOLVE_EXCLUDESYSTEM, RESOLVE_PREFERENCES, RESOLVEDEBUG, RESOURCEONLY, RUNBLACKLIST, RUNBUILDS, RUNBUNDLES, RUNBUNDLES_STARTLEVEL_ATTRIBUTE, RUNEE, RUNENV, RUNFRAMEWORK, RUNFRAMEWORK_NONE, RUNFRAMEWORK_SERVICES, RUNFRAMEWORKRESTART, RUNFW, RUNJDB, RUNKEEP, RUNNOREFERENCES, RUNOPTIONS, RUNOPTIONS_EAGER, RUNPATH, RUNPROGRAMARGS, RUNPROPERTIES, RUNPROVIDEDCAPABILITIES, RUNREMOTE, RUNREPOS, RUNREQUIRES, RUNSTARTLEVEL, RUNSTARTLEVEL_BEGIN, RUNSTARTLEVEL_ORDER, RUNSTARTLEVEL_STEP, RUNSTORAGE, RUNSYSTEMCAPABILITIES, RUNSYSTEMPACKAGES, RUNTIMEOUT, RUNTRACE, RUNVM, SAVEMANIFEST, SELECTION_FILTER_ATTRIBUTE, SERVICE_COMPONENT, SERVICELOADER_NAMESPACE, SERVICELOADER_REGISTER_DIRECTIVE, SIGN, SIGN_PASSWORD_DIRECTIVE, SIGNATURE_TEST, SINGLETON_DIRECTIVE, SIZE_ATTRIBUTE, SNAPSHOT, SOURCEPATH, SOURCES, SPECIFICATION_VERSION, SPLIT_PACKAGE_DIRECTIVE, STALECHECK, STANDALONE, STATIC_ATTRIBUTE, STRICT, SUB, SUBSTITUTE_ATTRIBUTE, SYSTEMPROPERTIES, TESTCASES, TESTCONTINUOUS, TESTER, TESTER_PLUGIN, TESTPACKAGES, TESTPATH, TESTSOURCES, TESTTERMINATE, TESTUNRESOLVED, TOOL, TRANSITIVE_ATTRIBUTE, TSTAMP, UNDERTEST, UPTO, USES_DIRECTIVE, USES_USES, VALID_PROPERTY_TYPES, VERSION_ATTR_HASH, VERSION_ATTR_LATEST, VERSION_ATTR_PROJECT, VERSION_ATTR_SNAPSHOT, VERSION_ATTRIBUTE, VERSION_FILTER, VERSIONDEFAULTS, VISIBILITY_DIRECTIVE, WAB, WABLIB, WORKINGSET, WORKINGSET_MEMBER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_p_allsourcepath
(String[] args) _p_bootclasspath
(String[] args) _p_buildpath
(String[] args) _p_dependson
(String[] args) _p_sourcepath
(String[] args) _p_testpath
(String[] args) void
void
private void
void
addClasspath
(File f) bnd maintains a class path that is set by the environment, i.e.(package private) static void
addToPackageList
(Container container, String newPackageNames) (package private) void
Run all after command pluginsvoid
baseline()
Do a baseline for this project(package private) void
Run all before command pluginsFile[]
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.private void
builtFiles
(Collection<File> files) void
bump()
void
Bump the version of this project.void
clean()
(package private) void
(package private) void
void
void
compile
(boolean test) private void
void
copy
(RepositoryPlugin source, Instructions filter, RepositoryPlugin destination) void
copy
(RepositoryPlugin source, String filter, RepositoryPlugin destination) Copy a repository to another repositoryvoid
deploy()
Deploy the current project to a repositoryvoid
Deploy the file (which must be a bundle) into the repository.void
Deploy the file (which must be a bundle) into the repository.private void
void
doMavenPom
(Strategy strategyx, List<Container> result, String action) The user selected pom in a path.private void
doPath
(Collection<Container> resultpath, Collection<Project> projects, Collection<Container> entries, Collection<Container> bootclasspath, boolean noproject, String name) Iterate over the entries and place the projects on the projects list and all the files of the entries on the resultpath.void
Deprecated.Export this project via the exporters.void
exportRunbundles
(String runFilePath, File outputDir) void
fillActions
(Map<String, Action> all) (package private) static String
getBsns()
Return the direct build dependencies of this project.getBuilder
(ProjectBuilder parent) Return a new builder that is nicely setup for this project.File[]
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) Get a bundle from one of the plugin repositories.getBundle
(org.osgi.resource.Resource r) private Container
getBundleByHash
(String bsn, Map<String, String> attrs) private Container
getBundleFromProject
(String bsn, Map<String, String> attrs) Look for the bundle in the workspace.(package private) Collection<Container>
getBundles
(Strategy strategy, String spec) Just calls a new method with a default parm.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.Get all bundles matching a wildcard expression.int
A checksum based on the values of the propertiesprivate Command
getCommonJavac
(boolean test) Get the contained packages calculated from all builders from the last buildgetDeliverable
(String bsn, Map<String, String> attrs) Answer the container associated with a given bsn.Returns containers for the deliverables of this project.Return the full transitive dependents of this project.Return the full transitive dependencies of this project.private Exporter
getExporter
(String type) Get the exported packages form all builders calculated from the last buildFile[]
getFiles()
Return the filesGet the object responsible for source code generation.private <T> T
getHandler
(Class<T> target, Collection<Container> containers, String header, String defaultHandler) Get the imported packages from all builders calculated from the last buildprotected Object[]
This should be overridden by subclasses to add extra macro command domains on the search list.private Makefile
getName()
getOutputFile
(String bsn) getOutputFile
(String bsn, String version) Calculate the file for a JAR.getPackageInfo
(String packageName) Get a launcher.(package private) List<RepositoryPlugin>
getReleaseRepos
(String names) List<org.osgi.resource.Resource>
boolean
getRunFw()
Return the run frameworkboolean
getRunVM()
Return a basic type only specification of the run aspect of this projectgetSrc()
Deprecated.private File
getSubBuilder
(File bndFile) Return a builder associated with the give bnd file or null.getSubBuilder
(String string) Return a build that maps to the sub file.private File
Return the direct test dependencies of this project.static Project
getUnparented
(File propertiesFile) getValidJar
(Jar jar, String id) getValidJar
(File f) This methods attempts to turn any jar into a valid jar.getValidJar
(URL url) getVersion
(String bsn) private void
install
(RepositoryPlugin repo, Processor context, File f, Attrs value) private void
boolean
isCnf()
boolean
Return if this is an interactive environment like Eclipse or runs in batch mode.boolean
Answer if this project does not have any outputboolean
boolean
isStale()
Check if this project needs building.(package private) boolean
boolean
boolean
isValid()
void
junit()
Run JUnitprivate void
justInTime
(Collection<Container> path, List<Container> entries, boolean noproject, String name) Handle dependencies for paths that are calculated on demand.private String
list
(String[] args, Collection<?> list) (package private) static void
mergeNames
(String names, Set<String> set) protected Strategy
overrideStrategy
(Map<String, String> attrs, Strategy useStrategy) Pack the project (could be a bndrun file) and save it on disk.Parse the list of bundles that are a prerequisite to this project.private List<org.osgi.resource.Resource>
private Parameters
parseReleaseRepos
(String names) protected Project.RepoFilter
parseRepoFilter
(Map<String, String> attrs) parseRunbundles
(String spec) void
Actions to perform after a full workspace release.protected void
Check prebuild things.void
prepare()
Set up all the pathsvoid
Actions to perform before a full workspace release.void
private void
boolean
refresh()
Refresh if we are based on stale data.void
private void
void
release()
void
release
(boolean test) void
Release.void
Releaserelease
(String jarName, InputStream jarStream) release
(String name, String jarName, InputStream jarStream) Releaseprivate URI
releaseRepo
(RepositoryPlugin releaseRepo, Processor context, String jarName, InputStream jarStream) releaseURI
(String jarName, InputStream jarStream) releaseURI
(String name, String jarName, InputStream jarStream) void
remove()
(package private) boolean
void
Report detailed info from this projectprotected void
private void
reportNewer
(long lastModified, Jar jar) void
run()
void
runLocal()
private File
saveBuildWithoutClose
(Jar jar) void
void
void
void
setDelayRunDependencies
(boolean x) Make this project delay the calculation of the run dependencies.void
setPackageInfo
(String packageName, Version newVersion) private void
void
test()
void
void
protected Container
toContainer
(String bsn, String range, Map<String, String> attrs, File result, DownloadBlocker db) (package private) Collection<File>
toFile
(Collection<Container> containers) Calculate the classpath.private Collection<?>
toFiles
(Collection<Project> projects) toString()
Printout of the status of this processor for toString()private void
void
verifyDependencies
(boolean test) Method to verify that the paths are correct, ie no missing dependenciesprivate void
verifyDependencies
(String title, Collection<Container> path) private File
write
(ConsumerWithException<File> jar, File outputFile) Methods inherited from class aQute.bnd.osgi.Processor
_basedir, _fileuri, _findfile, _frange, _native_capability, _propertiesdir, _propertiesname, _random, _thisfile, _uri, addBasicPlugin, addClose, addExtensions, addIncluded, addProperties, addProperties, append, appendPath, begin, beginHandleErrors, check, clear, close, concat, customize, decorated, decorated, doAttrbutes, doIncludeFile, doIncludeFile, endHandleErrors, error, error, exception, exists, findHeader, findHeader, findHeader, forceRefresh, formatArrays, get, get, getBase, getBaseURI, getClass, getDuration, getErrors, getExecutor, getFile, getFile, getFlattenedProperties, getFlattenedProperties, getHeader, getHeader, getHeader, getHeader, getIncluded, getInfo, getInfo, getInstructions, getJarFromName, getJavaExecutable, getLine, getLoader, getLocation, getLogger, getManifestAsProperties, getMergedParameters, getParameters, getParent, getPlugin, getPlugins, getPlugins, getProfile, getPromiseFactory, getProperties, getPropertiesFile, getProperty, getProperty, getProperty, getPropertyKeys, getReplacer, getScheduledExecutor, getSelfAndAncestors, getSettings, getTop, getUnexpandedProperty, getUnprocessedProperty, getWarnings, is, isDuplicate, isExceptions, isFailOk, isMissingPlugin, isOk, isPedantic, isPerfect, isTrace, isTrue, iterator, join, join, join, join, join, join, keySet, lastModified, loadProperties, makePrintable, merge, mergeLocalProperties, 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, setLocation, setParent, setPedantic, setProperties, setProperties, setProperties, setProperties, setPropertiesFile, setProperty, setTrace, setTypeSpecificPlugins, signal, since, split, split, split, spliterator, system, system, toFullHeaderPattern, trace, unsetProperty, updateModified, use, warning
Methods inherited from class aQute.bnd.osgi.Domain
copyFrom, domain, domain, domain, domain, domain, domain, domain, getBundleActivator, getBundleCategory, getBundleClasspath, getBundleClassPath, getBundleContactAddress, getBundleCopyright, getBundleDescription, getBundleDocURL, getBundleName, getBundleNative, getBundleRequiredExecutionEnvironment, getBundleSymbolicName, getBundleVendor, getBundleVersion, getDynamicImportPackage, getExportContents, getExportPackage, getFragmentHost, getIcon, getImportPackage, getIncludeResource, getParameters, getParameters, getParameters, getParameters, getPrivatePackage, getProvideCapability, getRequireBundle, getRequireCapability, getRunblacklist, getRunee, isSources, normalizeKey, setAugment, setBundleActivator, setBundleClasspath, setBundleRequiredExecutionEnvironment, setBundleSymbolicName, setBundleVersion, setBundleVersion, setConditionalPackage, setExportContents, setExportPackage, setFailOk, setImportPackage, setIncludePackage, setIncludeResource, setPrivatePackage, setRunblacklist, setRunee, setRunfw, setRunRequires, setSources, setTranslation, translate, translate
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
DEFAULT_ACTIONS
- See Also:
-
BNDFILE
- See Also:
-
BNDPATH
-
BNDCNF
- See Also:
-
SHA_256
- See Also:
-
workspace
-
preparedPaths
-
dependenciesFull
-
dependenciesBuild
-
dependenciesTest
-
dependents
-
classpath
-
buildpath
-
testpath
-
runpath
-
runbundles
-
runfw
-
runstorage
File runstorage -
sourcepath
-
allsourcepath
-
bootclasspath
-
versionMap
-
output
File output -
target
File target -
revision
-
files
-
delayRunDependencies
boolean delayRunDependencies -
msgs
-
ide
-
exportedPackages
-
importedPackages
-
containedPackages
-
packageInfo
-
makefile
-
resources
-
data
-
unreferencedClasspathEntries
-
instructions
-
_repoHelp
Macro access to the repository ${repo;[; [;<lowest|highest|exact>]]}
-
-
Constructor Details
-
Project
-
Project
-
-
Method Details
-
readBuildProperties
private void readBuildProperties() -
getUnparented
- Throws:
Exception
-
isValid
public boolean isValid() -
getBuilder
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:
Exception
-
getChanged
public int getChanged() -
setChanged
public void setChanged() -
getWorkspace
-
toString
Description copied from class:Processor
Printout of the status of this processor for toString() -
prepare
Set up all the paths- Throws:
Exception
-
getSrcOutput0
- Throws:
IOException
-
getTarget0
- Throws:
IOException
-
getSrc
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:
Exception
-
getSrcOutput
-
getTestSrc
-
getTestOutput
-
getTargetDir
-
traverse
private void traverse(Set<Project> dependencies, Project dependent, Set<Project> visited) throws Exception - Throws:
Exception
-
doPath
private void doPath(Collection<Container> resultpath, Collection<Project> projects, Collection<Container> entries, Collection<Container> bootclasspath, boolean noproject, 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 filesprojects
- The list that gets any projects that are entriesentries
- The input list of classpath entries
-
parseBuildpath
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:
Exception
-
parseRunpath
- Throws:
Exception
-
parseRunbundles
- Throws:
Exception
-
parseRunbundles
- Throws:
Exception
-
parseRunFw
- Throws:
Exception
-
parseTestpath
- Throws:
Exception
-
getBundles
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_HIGHESTspec
- The header- Throws:
Exception
-
getBundles
Just calls a new method with a default parm.- Throws:
Exception
-
getBundlesWildcard
public List<Container> getBundlesWildcard(String bsnPattern, String range, Strategy strategyx, Map<String, String> attrs) throws ExceptionGet 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:
Exception
-
mergeNames
-
flatten
-
addToPackageList
-
doMavenPom
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:
Exception
- anything goes wrong
-
getDependson
Return the full transitive dependencies of this project.- Returns:
- A set of the full transitive dependencies of this project.
- Throws:
Exception
-
getBuildDependencies
Return the direct build dependencies of this project.- Returns:
- A set of the direct build dependencies of this project.
- Throws:
Exception
-
getTestDependencies
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:
Exception
-
getDependents
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:
Exception
-
getBuildpath
- Throws:
Exception
-
getTestpath
- Throws:
Exception
-
justInTime
private void justInTime(Collection<Container> path, List<Container> entries, boolean noproject, String name) Handle dependencies for paths that are calculated on demand. -
getRunpath
- Throws:
Exception
-
getRunbundles
- Throws:
Exception
-
getRunFw
Return the run framework- Throws:
Exception
-
getRunStorage
- Throws:
Exception
-
getRunBuilds
public boolean getRunBuilds() -
getSourcePath
- Throws:
Exception
-
getAllsourcepath
- Throws:
Exception
-
getBootclasspath
- Throws:
Exception
-
getOutput
- Throws:
Exception
-
doEclipseClasspath
- Throws:
Exception
-
_p_dependson
- Throws:
Exception
-
toFiles
-
_p_buildpath
- Throws:
Exception
-
_p_testpath
- Throws:
Exception
-
_p_sourcepath
- Throws:
Exception
-
_p_allsourcepath
- Throws:
Exception
-
_p_bootclasspath
- Throws:
Exception
-
_p_output
- Throws:
Exception
-
list
-
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 classProcessor
-
release
- Throws:
Exception
-
releaseURI
- Throws:
Exception
-
release
Release- Parameters:
name
- The repository namejarName
-jarStream
-- Throws:
Exception
-
releaseURI
- Throws:
Exception
-
releaseRepo
private URI releaseRepo(RepositoryPlugin releaseRepo, Processor context, String jarName, InputStream jarStream) throws Exception - Throws:
Exception
-
getReleaseRepos
-
parseReleaseRepos
-
release
- Throws:
Exception
-
release
Release- Parameters:
name
- The respository nametest
- Run testcases- Throws:
Exception
-
getBundle
public Container getBundle(String bsn, String range, Strategy strategy, Map<String, String> attrs) throws ExceptionGet 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 namerange
- The version rangestrategy
- 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
- Parameters:
attrs
-useStrategy
-
-
parseRepoFilter
-
toContainer
protected Container toContainer(String bsn, String range, Map<String, String> attrs, File result, DownloadBlocker db) - Parameters:
bsn
-range
-attrs
-result
-
-
getBundleFromProject
Look for the bundle in the workspace. The premise is that the bsn must start with the project name.- Parameters:
bsn
- The bsnattrs
- Any attributes- Throws:
Exception
-
getBundleByHash
- Throws:
Exception
-
deploy
Deploy the file (which must be a bundle) into the repository.- Parameters:
name
- The repository namefile
- bundle- Throws:
Exception
-
deploy
Deploy the file (which must be a bundle) into the repository.- Parameters:
file
- bundle- Throws:
Exception
-
deploy
Deploy the current project to a repository- Throws:
Exception
-
_repo
- Throws:
Exception
-
add
- Throws:
Exception
-
getTarget
- Throws:
Exception
-
build
This is the external method that will pre-build any dependencies if it is out of date.- Parameters:
underTest
-- Throws:
Exception
-
install
- Throws:
Exception
-
getInstallRepositories
-
install
private void install(RepositoryPlugin repo, Processor context, File f, Attrs value) throws Exception - Throws:
Exception
-
getFiles
Return the files -
isStale
Check if this project needs building. This is defined as:- Throws:
Exception
-
isStale
- Throws:
Exception
-
getBuildFiles
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:
Exception
-
getBuildFiles
- Throws:
Exception
-
buildLocal
Build without doing any dependency checking. Make sure any dependent projects are built first.- Parameters:
underTest
-- Throws:
Exception
-
builtFiles
-
isNoBundles
public boolean isNoBundles()Answer if this project does not have any output -
saveBuild
- Throws:
Exception
-
saveBuildWithoutClose
- Throws:
Exception
-
write
private File write(ConsumerWithException<File> jar, File outputFile) throws IOException, InterruptedException, Exception - Throws:
IOException
InterruptedException
Exception
-
getOutputFile
Calculate the file for a JAR. The default name is bsn.jar, but this can be overridden with an- Throws:
Exception
-
getOutputFile
- Throws:
Exception
-
reportNewer
-
refresh
public boolean refresh()Refresh if we are based on stale data. This also implies our workspace. -
refreshData
private void refreshData() -
isCnf
public boolean isCnf() -
propertiesChanged
public void propertiesChanged()- Overrides:
propertiesChanged
in classProcessor
-
getName
-
getActions
-
fillActions
-
release
- Throws:
Exception
-
export
Export this project via the exporters. The return is the calculated name (can be overridden with the option `name`, which must be the basename since the extension is defined by the exporter)- Parameters:
type
- an exporter type like `bnd.executablejar` or null as default `bnd.executablejar.pack`, the original export functionoptions
- parameters to the exporters- Returns:
- and entry with the name and resource for the export
- Throws:
Exception
-
getExporter
-
export
Deprecated.The keep flag is really awkward since it overrides the -runkeep flag in the file. Use doExport instead- Throws:
Exception
-
exportRunbundles
- Throws:
Exception
- Since:
- 2.4
-
release
Release.- Parameters:
name
- The repository name- Throws:
Exception
-
clean
- Throws:
Exception
-
clean
- Throws:
IOException
-
clean
- Throws:
IOException
-
build
- Throws:
Exception
-
getMakefile
-
run
- Throws:
Exception
-
isRunTrace
public boolean isRunTrace() -
runLocal
- Throws:
Exception
-
test
- Throws:
Exception
-
test
- Throws:
Exception
-
test
- Throws:
Exception
-
junit
Run JUnit- Throws:
Exception
-
getValidJar
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:
Exception
-
getValidJar
- Throws:
Exception
-
getValidJar
- Throws:
Exception
-
_project
-
bump
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, seeMacro._version(String[])
- Throws:
Exception
-
replace
- Throws:
IOException
-
bump
- Throws:
Exception
-
action
- Throws:
Exception
-
action
- Throws:
Exception
-
before
Run all before command plugins -
after
Run all after command plugins -
refreshAll
public void refreshAll() -
script
- Throws:
Exception
-
script
- Throws:
Exception
-
_repos
- Throws:
Exception
-
_help
- Throws:
Exception
-
getDeliverables
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
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:
Exception
-
getSubBuilder
Return a build that maps to the sub file.- Parameters:
string
-- Throws:
Exception
-
getDeliverable
Answer the container associated with a given bsn.- Throws:
Exception
-
toFile
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:
Exception
-
getRunVM
-
getRunProgramArgs
-
getRunProperties
-
getProjectLauncher
Get a launcher.- Throws:
Exception
-
getProjectTester
- Throws:
Exception
-
getHandler
private <T> T getHandler(Class<T> target, Collection<Container> containers, String header, String defaultHandler) 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. -
addClasspath
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
-
pack
Pack the project (could be a bndrun file) and save it on disk. Report errors if they happen. Caller must close this JAR- Parameters:
profile
-- Returns:
- a jar with the executable code
- Throws:
Exception
-
baseline
Do a baseline for this project- Throws:
Exception
-
verifyDependencies
Method to verify that the paths are correct, ie no missing dependencies- Parameters:
test
- for test cases, also adds -testpath- Throws:
Exception
-
verifyDependencies
- Throws:
Exception
-
report
Report detailed info from this project -
report
- Throws:
Exception
-
compile
- Throws:
Exception
-
compile
- Throws:
Exception
-
getCommonJavac
- Throws:
Exception
-
_ide
- Throws:
IOException
-
getVersions
- Throws:
Exception
-
getBsns
- Throws:
Exception
-
getVersion
- Throws:
Exception
-
getExports
Get the exported packages form all builders calculated from the last build -
getImports
Get the imported packages from all builders calculated from the last build -
getContained
Get the contained packages calculated from all builders from the last build -
remove
- Throws:
Exception
-
getRunKeep
public boolean getRunKeep() -
setPackageInfo
- Throws:
Exception
-
getPackageInfo
- Throws:
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, String filter, RepositoryPlugin destination) throws Exception Copy a repository to another repository- Throws:
Exception
-
copy
public void copy(RepositoryPlugin source, Instructions filter, RepositoryPlugin destination) throws Exception - 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 classProcessor
-
getSpecification
Return a basic type only specification of the run aspect of this project -
getRunSystemPackages
-
getRunSystemCapabilities
-
preBuildChecks
protected void preBuildChecks()Check prebuild things. -
staleCheck
-
getBundle
- Throws:
Exception
-
isStandalone
public boolean isStandalone() -
getChecksum
Description copied from class:Processor
A checksum based on the values of the properties- Overrides:
getChecksum
in classProcessor
- Returns:
- A checksum based on the values of the properties
-
getGenerate
Get the object responsible for source code generation. This object should not be stored, a new one is created if the properties of this project change.- Returns:
- a fresh ProjectGenerate object
-
getResources
-
parseBuildResources
-