org.knopflerfish.ant.taskdefs.bundle
public class BundleManifestTask extends org.apache.tools.ant.Task
This task builds a manifest file from three different sources:
| Attribute | Description | Required |
| file | the manifest-file to create. | Yes if "attributePropertyPrefix" is empty, otherwise No. |
| encoding | The encoding used to read the existing manifest when updating. | No, defaults to UTF-8 encoding. |
| mode |
One of "update", "replace", "template" and "templateOnly"
default is "replace".
The "mode" determines which sources to use when creating the resulting manifest:
|
No. |
| templateFile | the template manifest file to load. | No. |
| attributePropertyPrefix | If set and a template file is given but no file
to write to export all attributes
from the main section of the template file as
properties.
If set and mode is one of "update", "replace" then create main section attributes for all project properties that starts with the prefix. If set and "file" is given then export all attributes written to the main section as properties. The name of property that maps to a main section attribute is the value of "attributePropertyPrefix" followed by the attribute name. The value is the attribute value. |
No. |
| kind | The kind of bundle that the manifest is for.
If given this string will be appended to the following manifest attributes of the main section:
|
No. |
| allKinds | A comma separated list specifying all kinds.
If given all main section attributes starting with
any of the kinds in |
No. |
| mainAttributesToSkip | Comma separated list with names of main section attributes to weed out when writing the manifest file. | No. |
| replaceEEmin | Replace the filter part of any osgi.ee requirement
for the OSGi/Minimum EE with the given value.
E.g., replaceEEmin="(&(osgi.ee=JavaSE)(version>=1.7))"
will replace any filter matching 'OSGi/Minimum'
in the osgi.ee name space with the given filter expression.
|
No. |
| verbose | If set to "true" then log the name of the bundle activator together with the imported and exported packages | No. |
One attribute for the manifest file. Those attributes that are not nested into a section will be added to the "Main" section.
| Attribute | Description | Required |
| name | the name of the attribute. | Yes |
| value | the value of the attribute. | Yes |
A manifest section - you can nest attribute elements into sections.
| Attribute | Description | Required |
| name | the name of the section. | No, if omitted it will be assumed to be the main section. |
<bundlemanifest mode="template"
kind="impl"
mainAttributesToSkip="Export-Package"
attributePropertyPrefix="bmfa."
templateFile="bundle.manifest"
verbose="true"
file="${outdir}/impl.mf">
<attribute name="Build-Date" value="${bundle.date}"/>
<attribute name="Built-From" value="${proj.dir}"/>
</bundlemanifest>
<bundlemanifest mode="template"
attributePropertyPrefix = "bmfa."
templateFile="bundle.manifest">
</bundlemanifest>
| Modifier and Type | Class and Description |
|---|---|
static class |
BundleManifestTask.Mode
Helper class for bundle manifest's mode attribute.
|
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
BUNDLE_EMPTY_STRING
Special value used to indicate that a Manifest.Attribute with
this value shall be weeded out.
|
| Constructor and Description |
|---|
BundleManifestTask()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConfiguredAttribute(org.apache.tools.ant.taskdefs.Manifest.Attribute attribute)
Add an attribute to the main section of the manifest.
|
void |
addConfiguredSection(org.apache.tools.ant.taskdefs.Manifest.Section section)
Add a section to the manifest.
|
void |
execute()
Create or update the Manifest when used as a task.
|
protected static boolean |
isPropertyValueEmpty(java.lang.String pval)
Check if a property value is empty or not.
|
void |
setAllKinds(java.lang.String s)
Comma separated list of known bundle kinds.
|
void |
setAttributePropertyPrefix(java.lang.String s)
Set the prefix of project properties to add main section
attributes for.
|
void |
setEncoding(java.lang.String encoding)
The encoding to use for reading in the manifest template file.
|
void |
setFile(java.io.File f)
The name of the manifest file to create.
|
void |
setKind(java.lang.String s)
Bundle kind, will be appended to some of the bundle specific
attributes in the main section.
|
void |
setMainAttributesToSkip(java.lang.String s)
Comma separated list of attributes to skip from the main section.
|
void |
setMode(BundleManifestTask.Mode m)
Which sources to use when creating the resulting manifest.
|
void |
setReplaceEEmin(java.lang.String s)
Sets the replacement filter expression for required capabilities in the
osgi.ee name-space that requires the OSGi/Minimum EE.
|
void |
setTemplateFile(java.io.File f)
The name of the template manifest file.
|
void |
setVerbose(boolean b)
Set the verbosity of this task.
|
void |
setVersionSuffix(java.lang.String s)
Set the verbosity of this task.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeprotected static final java.lang.String BUNDLE_EMPTY_STRING
public void setEncoding(java.lang.String encoding)
encoding - the manifest template file encoding.public void setTemplateFile(java.io.File f)
f - the template manifest file to load.public void setFile(java.io.File f)
f - the manifest file to write.public void setMode(BundleManifestTask.Mode m)
replace update template templateOnlym - the mode value one of - update,
replace, template and
templateOnly.public void setMainAttributesToSkip(java.lang.String s)
s - main section attributes to skip from out put.public void setKind(java.lang.String s)
s - the kind of bundle that we are writing a manifest file for.public void setAllKinds(java.lang.String s)
s - Comma separated list of bundle kinds.public void setReplaceEEmin(java.lang.String s)
s - public void setVerbose(boolean b)
b - verbose or not.public void setVersionSuffix(java.lang.String s)
b - verbose or not.public void setAttributePropertyPrefix(java.lang.String s)
s - the property names prefix to check for.public void addConfiguredSection(org.apache.tools.ant.taskdefs.Manifest.Section section)
throws org.apache.tools.ant.taskdefs.ManifestException
section - the manifest section to be added.org.apache.tools.ant.taskdefs.ManifestException - if the section is not valid.protected static boolean isPropertyValueEmpty(java.lang.String pval)
null, the empty string
or the special value BundleManifestTask.BUNDLE_EMPTY_STRING.pval - The property value to check.true if the value is empty.public void addConfiguredAttribute(org.apache.tools.ant.taskdefs.Manifest.Attribute attribute)
throws org.apache.tools.ant.taskdefs.ManifestException
attribute - the attribute to be added.org.apache.tools.ant.taskdefs.ManifestException - if the attribute is not valid.public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException - if the manifest cannot be written.