Package aQute.bnd.build
Class ProjectBuilder
- java.lang.Object
-
- aQute.bnd.osgi.Domain
-
- aQute.bnd.osgi.Processor
-
- aQute.bnd.osgi.Analyzer
-
- aQute.bnd.osgi.Builder
-
- aQute.bnd.build.ProjectBuilder
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class aQute.bnd.osgi.Analyzer
Analyzer.Check
-
Nested classes/interfaces inherited from class aQute.bnd.osgi.Processor
Processor.CL, Processor.FileLine
-
-
Field Summary
-
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 Constructor Description ProjectBuilder(Project project)
ProjectBuilder(ProjectBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClasspath(Container c)
Jar[]
builds()
Add some extra stuff to the builds() method like exporting.protected void
changedFile(java.io.File f)
void
doBaseline(Jar dot)
Compare this builder's JAR with a baselineprotected void
doneBuild(Builder builder)
Called when we're done with a builder.void
fillInLocationForPackageInfo(aQute.service.reporter.Report.Location location, java.lang.String packageName)
Jar
getBaselineJar()
This method attempts to find the baseline jar for the current project.aQute.bnd.build.ProjectBuilder.BuildInfoImpl
getBuildInfo()
java.util.List<Jar>
getClasspath()
java.util.List<Run>
getExportedRuns()
Return the bndrun files that need to be exportedJar
getLastRevision()
protected java.lang.Object[]
getMacroDomains()
We put our project and our workspace on the macro path.Project
getProject()
java.lang.String
getSourceFileFor(Descriptors.TypeRef type)
Find the source file for this typeBuilder
getSubBuilder()
ProjectBuilder
includeTestpath()
void
init()
Allow any local initialization by subclasses before we build.boolean
isInteractive()
Return if this is an interactive environment like Eclipse or runs in batch mode.long
lastModified()
void
report(java.util.Map<java.lang.String,java.lang.Object> table)
Create a report of the settingsprotected void
startBuild(Builder builder)
Called when we start to build a builder.java.lang.String
toString()
Printout of the status of this processor for toString()-
Methods inherited from class aQute.bnd.osgi.Builder
_githead, _maven_version, _permissions, addAll, addAll, addSourcepath, addSourcepath, analyze, build, cleanupVersion, cleanupVersion, doDiff, doNotCopy, doNotCopy, from, getClasspathEntrySuffix, getDoNotCopy, getExtra, getSourcePath, getSubBuilder, getSubBuilders, hasSources, isInScope, removeBundleSpecificHeaders, setSourcepath, setTypeSpecificPlugins, system
-
Methods inherited from class aQute.bnd.osgi.Analyzer
_bsn, _classes, _ee, _exporters, _exports, _findname, _findpath, _imports, _md5, _packageattribute, _packages, _sha1, addClasspath, addClasspath, addClasspath, assignable, assignable, assignable, assignable, begin, calcManifest, calculateExportsFromContents, check, cleanupUses, cleanupVersion, clear, close, doRequireBnd, doUses, findClass, findClasspathEntry, findResource, findResources, forceRefresh, getAPIUses, getBndInfo, getBndLastModified, getBndVersion, getBsn, getBundleClassPathEntry, getBundleClassPathTypes, getClasses, getClasspathExports, getClassSignature, getClassspace, getClassspace, getContained, getDescriptor, getEEs, getExports, getFieldSignature, getHighestEE, getHostPackages, getImports, getJar, getJarFromName, getJarsFromName, getLowestEE, getManifest, getMethodSignature, getName, getOutputFile, getPackageInfo, getPackageRef, getPackages, getPrivates, getReferred, getRequireBundlePackages, getSourceFileFor, getTarget, getTypeRef, getTypeRefFromFQN, getTypeRefFromPath, getUnreachable, getUses, getVersion, getVersionPolicy, getXRef, isImported, isNoBundle, mergeManifest, nonClassReferTo, putAll, referred, referTo, referToByBinaryName, save, setBase, setClasspath, setClasspath, setClasspath, setClasspath, setDefaults, setDiagnostics, setJar, setJar, setTypeLocation, validResourcePath
-
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, beginHandleErrors, check, concat, customize, decorated, decorated, doAttrbutes, doIncludeFile, doIncludeFile, endHandleErrors, error, error, exception, exists, findHeader, findHeader, findHeader, formatArrays, get, get, getBase, getBaseURI, getChecksum, getClass, getDuration, getErrors, getExecutor, getFile, getFile, getFlattenedProperties, getFlattenedProperties, getHeader, getHeader, getHeader, getHeader, getIncluded, getInfo, getInfo, getInstructions, 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, 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, propertiesChanged, quote, read, refresh, removeBasicPlugin, removeClose, removeDuplicateMarker, replaceAll, replaceExtension, report, set, setExceptions, setFileMustExist, setForceLocal, setLocation, setParent, setPedantic, setProperties, setProperties, setProperties, setProperties, setPropertiesFile, setProperty, setTrace, signal, since, split, split, split, spliterator, 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
-
-
-
-
Constructor Detail
-
ProjectBuilder
public ProjectBuilder(Project project)
-
ProjectBuilder
public ProjectBuilder(ProjectBuilder builder)
-
-
Method Detail
-
lastModified
public long lastModified()
- Overrides:
lastModified
in classProcessor
-
getMacroDomains
protected java.lang.Object[] getMacroDomains()
We put our project and our workspace on the macro path.- Overrides:
getMacroDomains
in classProcessor
-
getSubBuilder
public Builder getSubBuilder() throws java.lang.Exception
- Overrides:
getSubBuilder
in classBuilder
- Throws:
java.lang.Exception
-
getProject
public Project getProject()
-
init
public void init()
Description copied from class:Builder
Allow any local initialization by subclasses before we build.
-
addClasspath
public void addClasspath(Container c) throws java.io.IOException
- Throws:
java.io.IOException
-
getClasspath
public java.util.List<Jar> getClasspath()
- Overrides:
getClasspath
in classAnalyzer
-
changedFile
protected void changedFile(java.io.File f)
- Overrides:
changedFile
in classBuilder
-
doBaseline
public void doBaseline(Jar dot) throws java.lang.Exception
Compare this builder's JAR with a baseline- Overrides:
doBaseline
in classBuilder
- Throws:
java.lang.Exception
-
fillInLocationForPackageInfo
public void fillInLocationForPackageInfo(aQute.service.reporter.Report.Location location, java.lang.String packageName) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getLastRevision
public Jar getLastRevision() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getBaselineJar
public Jar getBaselineJar() throws java.lang.Exception
This method attempts to find the baseline jar for the current project. It reads the -baseline property and treats it as instructions. These instructions are matched against the bsns of the jars (think sub builders!). If they match, the sub builder is selected.The instruction can then specify the following options:
version : baseline version from repository file : a file path
If neither is specified, the current version is used to find the highest version (without qualifier) that is below the current version. If a version is specified, we take the highest version with the same base version.Since baselining is expensive and easily generates errors you must enable it. The easiest solution is to
-baseline: *
. This will match all sub builders and will calculate the version.- Returns:
- a Jar or null
- Throws:
java.lang.Exception
-
report
public void report(java.util.Map<java.lang.String,java.lang.Object> table) throws java.lang.Exception
Create a report of the settings
-
toString
public java.lang.String toString()
Description copied from class:Processor
Printout of the status of this processor for toString()
-
getExportedRuns
public java.util.List<Run> getExportedRuns() throws java.lang.Exception
Return the bndrun files that need to be exported- Throws:
java.lang.Exception
-
builds
public Jar[] builds() throws java.lang.Exception
Add some extra stuff to the builds() method like exporting.
-
startBuild
protected void startBuild(Builder builder) throws java.lang.Exception
Called when we start to build a builder. We reset our map of bsn -> version and set the default contents of the bundle.- Overrides:
startBuild
in classBuilder
- Throws:
java.lang.Exception
-
doneBuild
protected void doneBuild(Builder builder) throws java.lang.Exception
Called when we're done with a builder. In this case we retrieve package information from builder.
-
getSourceFileFor
public java.lang.String getSourceFileFor(Descriptors.TypeRef type) throws java.lang.Exception
Find the source file for this type- Overrides:
getSourceFileFor
in classAnalyzer
- Parameters:
type
-- 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 classProcessor
-
includeTestpath
public ProjectBuilder includeTestpath()
-
getBuildInfo
public aQute.bnd.build.ProjectBuilder.BuildInfoImpl getBuildInfo()
-
-