aQute.bnd.build
Class ProjectBuilder

java.lang.Object
  extended by aQute.bnd.osgi.Domain
      extended by aQute.bnd.osgi.Processor
          extended by aQute.bnd.osgi.Analyzer
              extended by aQute.bnd.osgi.Builder
                  extended by aQute.bnd.build.ProjectBuilder
All Implemented Interfaces:
Constants, Registry, Report, Reporter, Closeable, Iterable<String>

public class ProjectBuilder
extends Builder


Nested Class Summary
 
Nested classes/interfaces inherited from class aQute.bnd.osgi.Processor
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
 
Fields inherited from class aQute.bnd.osgi.Analyzer
msgs
 
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, BUILDFILES, BUILDPACKAGES, BUILDPATH, BUMPPOLICY, BUNDLE_ACTIVATIONPOLICY, BUNDLE_ACTIVATOR, BUNDLE_BLUEPRINT, BUNDLE_CATEGORY, BUNDLE_CLASSPATH, BUNDLE_CONTACTADDRESS, BUNDLE_COPYRIGHT, BUNDLE_DESCRIPTION, 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, 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, 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_TESTER_BSN, DEPENDSON, DEPLOY, DEPLOYREPO, DESCRIPTION_ATTRIBUTE, DIFFIGNORE, DIGESTS, directives, DONOTCOPY, DSANNOTATIONS, DUPLICATE_MARKER, DYNAMICIMPORT_PACKAGE, EFFECTIVE_DIRECTIVE, EMBEDDED_REPO, EMPTY, EMPTY_HEADER, EXCLUDE_DIRECTIVE, EXPERIMENTS, EXPORT_CONTENTS, EXPORT_PACKAGE, EXPORT_SERVICE, EXTENSION_DIRECTIVE, FAIL_OK, FILTER_DIRECTIVE, FRAGMENT_ATTACHMENT_DIRECTIVE, FRAGMENT_HOST, FROM_DIRECTIVE, headers, IGNORE_PACKAGE, IMPORT_DIRECTIVE, IMPORT_PACKAGE, IMPORT_PRIVATE, IMPORT_REFERENCE, IMPORT_SERVICE, importDirectives, INCLUDE, INCLUDE_DIRECTIVE, INCLUDE_RESOURCE, INCLUDERESOURCE, 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, METAPACKAGES, METATYPE, NAME_ATTRIBUTE, NAMESECTION, NAMESPACE_STEM, NO_IMPORT_DIRECTIVE, NOANNOTATIONS, NOBUNDLES, NODEFAULTVERSION, NOEXTRAHEADERS, NOMANIFEST, NONE, NOUSES, options, OSNAME_ATTRIBUTE, OSVERSION_ATTRIBUTE, OUTPUT, PACKAGE, PACKAGE_JPM, PATH_DIRECTIVE, PEDANTIC, PLUGIN, PLUGINPATH, POM, PRESENCE_DIRECTIVE, PRIVATE_DIRECTIVE, PRIVATE_PACKAGE, 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, RESOURCEONLY, RUNBUILDS, RUNBUNDLES, RUNEE, RUNFRAMEWORK, RUNFRAMEWORK_NONE, RUNFRAMEWORK_SERVICES, RUNFW, 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, TESTCASES, TESTCONTINUOUS, TESTER_PLUGIN, TESTPACKAGES, TESTPATH, TESTREPORT, TESTSUITES, TOOL, UNDERTEST, USES_DIRECTIVE, USES_USES, VALID_PROPERTY_TYPES, VERBOSE, VERSION_ATTRIBUTE, VERSION_FILTER, VISIBILITY_DIRECTIVE, WAB, WABLIB
 
Constructor Summary
ProjectBuilder(Project project)
           
ProjectBuilder(ProjectBuilder builder)
           
 
Method Summary
protected  void changedFile(File f)
           
 void doBaseline(Jar dot)
          Compare this builder's JAR with a baseline
 void fillInLocationForPackageInfo(Report.Location location, String packageName)
           
 Jar getBaselineJar()
          This method attempts to find the baseline jar for the current project.
 List<Jar> getClasspath()
           
 Jar getLastRevision()
           
protected  Object[] getMacroDomains()
          We put our project and our workspace on the macro path.
 Project getProject()
           
 Builder getSubBuilder()
           
 void init()
          Allow any local initialization by subclasses before we build.
 long lastModified()
           
 
Methods inherited from class aQute.bnd.osgi.Builder
_maven_version, _permissions, addAll, addAll, addSourcepath, addSourcepath, analyze, build, builds, cleanupVersion, close, doDiff, doNotCopy, getClasspathEntrySuffix, getDoNotCopy, getExtra, getSourcePath, getSubBuilder, getSubBuilders, hasSources, isInScope, removeBundleSpecificHeaders, setSourcepath, setTypeSpecificPlugins
 
Methods inherited from class aQute.bnd.osgi.Analyzer
_bsn, _classes, _ee, _exporters, _exports, _findname, _findpath, _imports, _md5, _sha1, addClasspath, addClasspath, addClasspath, begin, calcManifest, calculateExportsFromContents, cleanupUses, cleanupVersion, clear, doUses, findClass, findResource, getAPIUses, getBndInfo, getBndLastModified, getBndVersion, getBsn, getClasses, getClasspathExports, getClassspace, getClassspace, getContained, getDescriptor, getExports, getImports, getJar, getLowestEE, getManifest, getOutputFile, getPackageRef, getPrivates, getReferred, getTarget, getTypeRef, getTypeRefFromFQN, getTypeRefFromPath, getUnreachable, getUses, getVersion, getVersionPolicy, getXRef, isImported, isNoBundle, mergeManifest, putAll, referred, referTo, referToByBinaryName, save, setBase, setClasspath, setClasspath, setClasspath, setDefaults, setDiagnostics, setJar, setJar
 
Methods inherited from class aQute.bnd.osgi.Processor
_basedir, _native_capability, _random, addBasicPlugin, addClose, addIncluded, addProperties, addProperties, append, appendPath, beginHandleErrors, check, customize, doAttrbutes, doIncludeFile, doIncludeFile, endHandleErrors, error, error, exception, exists, findHeader, findHeader, forceRefresh, formatArrays, get, get, getBase, getClass, getDuration, getErrors, getExecutor, getFile, getFile, getFlattenedProperties, getHeader, getHeader, getIncluded, getInfo, getInfo, getLine, getLocation, getManifestAsProperties, getParent, getPlugin, getPlugins, getPlugins, getProperties, getPropertiesFile, getProperty, getProperty, getPropertyKeys, getReplacer, getTop, getUnprocessedProperty, getWarnings, isDuplicate, isExceptions, isFailOk, isMissingPlugin, isOk, isPedantic, isPerfect, isTrace, isTrue, iterator, join, join, join, join, join, keySet, loadPlugins, loadProperties, makePrintable, merge, mergeProperties, mergeProperties, newHashMap, newList, newList, newMap, newMap, newSet, newSet, normalize, normalize, parseHeader, parseHeader, printClause, printClauses, printClauses, progress, progress, propertiesChanged, quote, read, refresh, removeBasicPlugin, removeClose, removeDuplicateMarker, replaceAll, replaceExtension, report, set, setExceptions, setFileMustExist, setForceLocal, setParent, setPedantic, setProperties, setProperties, setProperties, setProperty, setTrace, signal, split, split, split, toString, 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
 

Constructor Detail

ProjectBuilder

public ProjectBuilder(Project project)

ProjectBuilder

public ProjectBuilder(ProjectBuilder builder)
Method Detail

lastModified

public long lastModified()
Overrides:
lastModified in class Processor

getMacroDomains

protected Object[] getMacroDomains()
We put our project and our workspace on the macro path.

Overrides:
getMacroDomains in class Processor
Returns:

getSubBuilder

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

getProject

public Project getProject()

init

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

Overrides:
init in class Builder

getClasspath

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

changedFile

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

doBaseline

public void doBaseline(Jar dot)
                throws Exception
Compare this builder's JAR with a baseline

Overrides:
doBaseline in class Builder
Throws:
Exception

fillInLocationForPackageInfo

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

getLastRevision

public Jar getLastRevision()
                    throws Exception
Throws:
Exception

getBaselineJar

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

The instruction can then specify the following options:

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

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

Returns:
a Jar or null
Throws:
Exception


Copyright © 2013 aQute SARL. All rights reserved.