aQute.lib.osgi
Class Builder
java.lang.Object
aQute.lib.osgi.Processor
aQute.lib.osgi.Analyzer
aQute.lib.osgi.Builder
- All Implemented Interfaces:
- Registry, Constants, Reporter, java.io.Closeable
- Direct Known Subclasses:
- ProjectBuilder
public class Builder
- extends Analyzer
Include-Resource: ( [name '=' ] file )+
Private-Package: package-decl ( ',' package-decl )*
Export-Package: package-decl ( ',' package-decl )*
Import-Package: package-decl ( ',' package-decl )*
| Fields inherited from interface aQute.lib.osgi.Constants |
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_IMMEDIATE, COMPONENT_IMPLEMENTATION, COMPONENT_MODIFIED, COMPONENT_MULTIPLE, COMPONENT_NAME, COMPONENT_OPTIONAL, COMPONENT_PROPERTIES, COMPONENT_PROVIDE, COMPONENT_SERVICEFACTORY, COMPONENT_VERSION, componentDirectives, CONDITIONAL_PACKAGE, CONDUIT, CONSUMER_POLICY, 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, directives, DONOTCOPY, DUPLICATE_MARKER, DYNAMICIMPORT_PACKAGE, EMBEDDED_REPO, EMPTY, EMPTY_HEADER, EXCLUDE_DIRECTIVE, EXPORT_CONTENTS, EXPORT_PACKAGE, EXPORT_SERVICE, EXTENSION_DIRECTIVE, FAIL_OK, 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, JIDENTIFIER, KEYSTORE_LOCATION_DIRECTIVE, KEYSTORE_PASSWORD_DIRECTIVE, KEYSTORE_PROVIDER_DIRECTIVE, LANGUAGE_ATTRIBUTE, LAUNCHER_PLUGIN, LIB_DIRECTIVE, LINK_ATTRIBUTE, MAKE, MANDATORY_DIRECTIVE, MANIFEST, METAPACKAGES, METATYPE, NAME_ATTRIBUTE, NAMESECTION, NAMESPACE_STEM, NO_IMPORT_DIRECTIVE, NOANNOTATIONS, NOBUNDLES, NODEFAULTVERSION, NOEXTRAHEADERS, NOMANIFEST, NONE, NOPE, NOUSES, options, OSNAME_ATTRIBUTE, OSVERSION_ATTRIBUTE, PATH_DIRECTIVE, PEDANTIC, PLUGIN, POM, PRESENCE_DIRECTIVE, PRIVATE_DIRECTIVE, PRIVATE_PACKAGE, PROCESSOR_ATTRIBUTE, PROVIDE_DIRECTIVE, PROVIDER_POLICY, RELEASEREPO, REMOVE_ATTRIBUTE_DIRECTIVE, REMOVEHEADERS, REPORTNEWER, REQUIRE_BND, REQUIRE_BUNDLE, RESOLUTION_DIRECTIVE, RESOURCEONLY, RUNBUILDS, RUNBUNDLES, RUNFRAMEWORK, RUNFRAMEWORK_NONE, RUNFRAMEWORK_SERVICES, RUNPATH, RUNPATH_LAUNCHER_DIRECTIVE, RUNPATH_MAIN_DIRECTIVE, RUNPROPERTIES, RUNSTORAGE, RUNSYSTEMPACKAGES, RUNTIMEOUT, RUNTRACE, RUNVM, SAVEMANIFEST, SELECTION_FILTER_ATTRIBUTE, SERVICE_COMPONENT, SET_COMPONENT_DIRECTIVES, SET_COMPONENT_DIRECTIVES_1_1, SIGN, SIGN_PASSWORD_DIRECTIVE, SIGNATURE_TEST, SINGLETON_DIRECTIVE, SIZE_ATTRIBUTE, SNAPSHOT, SOURCEPATH, SOURCES, SPECIFICATION_VERSION, SPLIT_PACKAGE_DIRECTIVE, SUB, TESTCASES, TESTCONTINUOUS, TESTER_PLUGIN, TESTPACKAGES, TESTPATH, TESTREPORT, TOOL, UNDERTEST, USES_DIRECTIVE, USES_USES, VALID_PROPERTY_TYPES, VERBOSE, VERSION_ATTRIBUTE, VERSION_FILTER, VERSIONPOLICY, VERSIONPOLICY_IMPL, VERSIONPOLICY_USES, VISIBILITY_DIRECTIVE, WAB, WABLIB |
|
Method Summary |
java.lang.String |
_maven_version(java.lang.String[] args)
A macro to convert a maven version to an OSGi version |
java.lang.String |
_permissions(java.lang.String[] args)
|
void |
addSourcepath(java.io.File cp)
|
void |
analyze()
Intercept the call to analyze and cleanup versions after we have analyzed
the setup. |
Jar |
build()
|
Jar[] |
builds()
Build Multiple jars. |
protected void |
changedFile(java.io.File f)
|
void |
cleanupVersion(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> mapOfMap,
java.lang.String defaultVersion)
|
void |
close()
|
boolean |
doNotCopy(java.lang.String v)
doNotCopy
The doNotCopy variable maintains a patter for files that should not be
copied. |
java.lang.String |
getClasspathEntrySuffix(java.io.File resource)
Answer the string of the resource that it has in the container. |
java.util.regex.Pattern |
getDoNotCopy()
|
protected java.lang.String |
getImportPackages()
Analyzer has an empty default but the builder has a * as default. |
java.util.Collection<java.io.File> |
getSourcePath()
|
Builder |
getSubBuilder()
|
Builder |
getSubBuilder(java.io.File file)
|
java.util.List<Builder> |
getSubBuilders()
Answer a list of builders that represent this file or a list of files
specified in -sub. |
boolean |
hasSources()
|
void |
init()
Allow any local initialization by subclasses before we build. |
boolean |
isInScope(java.util.Collection<java.io.File> resources)
Check if the given resource is in scope of this bundle. |
void |
removeBundleSpecificHeaders()
|
void |
setSourcepath(java.io.File[] files)
|
protected void |
setTypeSpecificPlugins(java.util.Set<java.lang.Object> list)
|
| Methods inherited from class aQute.lib.osgi.Analyzer |
_bsn, _classes, _exporters, _findname, _findpath, _md5, _sha1, addClasspath, addClasspath, analyzeBundleClasspath, begin, calcManifest, calculateExportsFromContents, checkClass, cleanupVersion, clear, doUses, findClass, findResource, getBndInfo, getBndLastModified, getBndVersion, getBsn, getBundleClasspath, getClasses, getClasspath, getClassspace, getContained, getExports, getGroups, getImports, getJar, getManifest, getPackage, getReferred, getTarget, getUnreachable, getUses, getVersion, getVersionPolicy, isNoBundle, mergeManifest, putAll, referred, referTo, setBase, setClasspath, setClasspath, setClasspath, setJar, setJar |
| Methods inherited from class aQute.lib.osgi.Processor |
_basedir, _random, addBasicPlugin, addClose, addIncluded, addProperties, append, appendPath, beginHandleErrors, customize, doAttrbutes, doIncludeFile, endHandleErrors, error, error, exists, forceRefresh, formatArrays, getBase, getClass, getDuration, getErrors, getExecutor, getFile, getFile, getFlattenedProperties, getInfo, getInfo, getMacroDomains, getManifestAsProperties, getParent, getPlugin, getPlugins, getPlugins, getProperties, getPropertiesFile, getProperty, getProperty, getReplacer, getTop, getWarnings, isDuplicate, isExceptions, isFailOk, isMissingPlugin, isOk, isPedantic, isPerfect, isTrace, isTrue, join, join, join, join, join, lastModified, loadPlugins, loadProperties, makePrintable, merge, merge, mergeProperties, mergeProperties, newHashMap, newList, newList, newMap, newMap, newSet, newSet, normalize, normalize, parseHeader, parseHeader, printClause, printClauses, printClauses, progress, propertiesChanged, read, refresh, removeBasicPlugin, removeDuplicateMarker, replaceAll, setExceptions, setFileMustExist, setForceLocal, setParent, setPedantic, setProperties, setProperties, setProperties, setProperty, setTrace, signal, split, split, split, trace, unsetProperty, updateModified, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Builder
public Builder(Processor parent)
Builder
public Builder()
build
public Jar build()
throws java.lang.Exception
- Throws:
java.lang.Exception
init
public void init()
throws java.lang.Exception
- Allow any local initialization by subclasses before we build.
- Throws:
java.lang.Exception
changedFile
protected void changedFile(java.io.File f)
hasSources
public boolean hasSources()
getImportPackages
protected java.lang.String getImportPackages()
- Description copied from class:
Analyzer
- Analyzer has an empty default but the builder has a * as default.
- Overrides:
getImportPackages in class Analyzer
- Returns:
analyze
public void analyze()
throws java.lang.Exception
- Intercept the call to analyze and cleanup versions after we have analyzed
the setup. We do not want to cleanup if we are going to verify.
- Overrides:
analyze in class Analyzer
- Throws:
java.io.IOException
java.lang.Exception
cleanupVersion
public void cleanupVersion(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> mapOfMap,
java.lang.String defaultVersion)
getSourcePath
public java.util.Collection<java.io.File> getSourcePath()
setSourcepath
public void setSourcepath(java.io.File[] files)
addSourcepath
public void addSourcepath(java.io.File cp)
close
public void close()
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class Analyzer
builds
public Jar[] builds()
throws java.lang.Exception
- Build Multiple jars. If the -sub command is set, we filter the file with
the given patterns.
- Returns:
-
- Throws:
java.lang.Exception
getSubBuilders
public java.util.List<Builder> getSubBuilders()
throws java.lang.Exception
- Answer a list of builders that represent this file or a list of files
specified in -sub. This list can be empty. These builders represents to
be created artifacts and are each scoped to such an artifacts. The
builders can be used to build the bundles or they can be used to find out
information about the to be generated bundles.
- Returns:
- List of 0..n builders representing artifacts.
- Throws:
java.lang.Exception
getSubBuilder
public Builder getSubBuilder(java.io.File file)
throws java.lang.Exception
- Throws:
java.lang.Exception
getSubBuilder
public Builder getSubBuilder()
throws java.lang.Exception
- Throws:
java.lang.Exception
_maven_version
public java.lang.String _maven_version(java.lang.String[] args)
- A macro to convert a maven version to an OSGi version
_permissions
public java.lang.String _permissions(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException
removeBundleSpecificHeaders
public void removeBundleSpecificHeaders()
isInScope
public boolean isInScope(java.util.Collection<java.io.File> resources)
throws java.lang.Exception
- Check if the given resource is in scope of this bundle. That is, it
checks if the Include-Resource includes this resource or if it is a class
file it is on the class path and the Export-Pacakge or Private-Package
include this resource.
For now, include resources are skipped.
- Parameters:
f -
- Returns:
-
- Throws:
java.lang.Exception
getClasspathEntrySuffix
public java.lang.String getClasspathEntrySuffix(java.io.File resource)
throws java.lang.Exception
- Answer the string of the resource that it has in the container.
- Parameters:
resource - The resource to look for
- Returns:
-
- Throws:
java.lang.Exception
doNotCopy
public boolean doNotCopy(java.lang.String v)
- doNotCopy
The doNotCopy variable maintains a patter for files that should not be
copied. There is a default
Constants.DEFAULT_DO_NOT_COPY but this ca be
overridden with the Constants.DONOTCOPY property.
getDoNotCopy
public java.util.regex.Pattern getDoNotCopy()
setTypeSpecificPlugins
protected void setTypeSpecificPlugins(java.util.Set<java.lang.Object> list)
- Overrides:
setTypeSpecificPlugins in class Processor
Copyright å© aQute SARL (2000, 2011). All Rights Reserved.