|
Knopflerfish OSGi 2.4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.knopflerfish.ant.taskdefs.bundle.BundleManifestTask
public class BundleManifestTask
Extension of the standard Manifest 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 mainfest 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 mapps 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. |
mainAttributesToSkip | Comma separated list with names of main section attributes to weed out when writing the manifest file. | 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>
Nested Class Summary | |
---|---|
static class |
BundleManifestTask.Mode
Helper class for bundle manifest's mode attribute. |
Field Summary | |
---|---|
protected static java.lang.String |
BUNDLE_EMPTY_STRING
Special value used to indicate that a Manifest.Attribute with this value shall be weeded out. |
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
BundleManifestTask()
Default constructor. |
Method Summary | |
---|---|
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 |
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 |
setTemplateFile(java.io.File f)
The name of the template manifest file. |
void |
setVerbose(boolean b)
Set the verbosity of this task. |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String BUNDLE_EMPTY_STRING
Constructor Detail |
---|
public BundleManifestTask()
Method Detail |
---|
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
templateOnly
m
- 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 setVerbose(boolean b)
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.Task
org.apache.tools.ant.BuildException
- if the manifest cannot be written.
|
Knopflerfish OSGi 2.4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |