...
Include Page | |||
---|---|---|---|
|
|
...
Wiki Markup |
---|
{html}
<div class="content">
{html} |
...
iPOJO
...
Ant
...
Task
...
iPOJO
...
Ant
...
Task
...
allows
...
automating
...
the
...
iPOJO
...
manipulation
...
process
...
within
...
an
...
Ant
...
build
...
process.
...
This
...
page
...
explains
...
how
...
to
...
use
...
the
...
iPOJO
...
Ant
...
Task
...
and
...
how
...
to
...
combine
...
them
...
with
...
the
...
BND
...
Tasks.
Wiki Markup |
---|
_ {div:class=toc} {toc:maxLevel=4|minLevel=2} {div} h2. |
Downloading
...
the
...
iPOJO
...
Ant
...
Task
...
The
...
iPOJO
...
Ant
...
Task
...
can
...
ben
...
downloaded
...
from
...
...
.
How to use the Ant Task
The iPOJO Ant task take an input bundle and a metadata file and create the final (i.e.
...
manipulated)
...
bundle.
...
To
...
use
...
the
...
task
...
declare
...
a
...
target
...
in
...
your
...
build.xml
...
as:
Wiki Markup |
---|
{div:class=pom} <target name="main"> {color:red}<!-- Change the path to point on the iPOJO Ant task jar-->{color} <taskdef name="ipojo" classname="org.apache.felix.ipojo.task.IPojoTask" {color:red}classpath="org.apache.felix.ipojo.ant-1.6.0.jar"{color}/> <ipojo input="foo.jar" metadata = "meta.xml" /> </target> {div} |
First,
...
define
...
the
...
new
...
task.
...
Then
...
simply
...
use
...
it.
...
The
...
input
...
argument
...
describe
...
the
...
input
...
bundle
...
(must
...
exists)
...
and
...
the
...
metadata
...
argument
...
describes
...
the
...
metadata
...
file
...
(must
...
exist
...
too).
...
The
...
input
...
bundle
...
must
...
be
...
a
...
well-formed
...
bundle.
...
Ant
...
Task
...
Arguments
...
The
...
iPOJO
...
Ant
...
Task
...
as
...
three
...
different
...
arguments:
...
- Input:
...
- describes
...
- the
...
- input
...
- bundle.
...
- This
...
- argument
...
- is
...
- mandatory.
...
- Output:
...
- describes
...
- the
...
- output
...
- bundle.
...
- This
...
- argument
...
- is
...
- optional.
...
- If
...
- not
...
- present,
...
- the
...
- output
...
- file
...
- will
...
- be
...
- input
...
- file.
...
- Metadata:
...
- describes
...
- the
...
- metadata
...
- file.
...
- This
...
- argument
...
- is
...
- optional.
...
- By
...
- default,
...
- it
...
- tries
...
- with
...
- a
...
- metadata.xml
...
- file
...
- (in
...
- the
...
- same
...
- directory
...
- as
...
- the
...
- build.xml
...
- file).
...
- If
...
- the
...
- default
...
- file
...
- is
...
- not
...
- present,
...
- it
...
- tries
...
- to
...
- use
...
- only
...
- iPOJO
...
- annotations.
...
- IgnoreAnnotations:
...
- if
...
- set
...
- to
...
true
...
- ,
...
- the
...
- manipulator
...
- skips
...
- annotations
...
- processing
...
- (can
...
- reduce
...
- significantly
...
- the
...
- processing
...
- time
...
- on
...
- huge
...
- bundle).
...
- IgnoreEmbeddedSchemas:
...
- if
...
- set
...
- to
...
true
...
- ,
...
- the
...
- manipulator
...
- doesn't
...
- use
...
- embedded
...
- XML-Schemas
...
Combining
...
the
...
iPOJO
...
Ant
...
Task
...
and
...
BND
...
The
...
iPOJO
...
Ant
...
Task
...
requires
...
an
...
input
...
bundle.
...
BND
...
is
...
a
...
tools
...
simplifying
...
bundle
...
creation.
...
So,
...
it
...
is
...
possible
...
to
...
combine
...
the
...
two
...
tools
...
to
...
create
...
your
...
bundle
...
automatically.
...
The
...
following
...
build.xml
...
shows
...
you
...
an
...
example
...
of
...
combination.
Wiki Markup |
---|
{div:class=pom} <project default="main" basedir="."> <target name="bnd"> {color:red}<!-- Change to use the latest BND version --{color}{color:red}>{color} <taskdef resource="aQute/bnd/ant/taskdef.properties" {color:red}classpath="bnd-0.0.178.jar"{color}/> <bnd classpath="src" eclipse="true" failok="false" exceptions="true" {color:red}files="foo.bnd"{color}/> </target> <target name="main" depends="bnd"> <echo message="Call main"/> {color:red}<!-- Change the path to point on the iPOJO Ant task jar -->{color} <taskdef name="ipojo" classname="org.apache.felix.ipojo.task.IPojoTask" {color:red}classpath="org.apache.felix.ipojo.ant-1.6.0.jar"{color} /> <ipojo {color:red}input="foo.jar"{color} metadata = "meta.xml" /> </target> </project> {div} |
The
...
first
...
target
...
creates
...
the
...
bundle
...
with
...
BND.
...
More
...
details
...
on
...
the
...
BND
...
Ant
...
Task
...
are
...
available
...
here.
...
To
...
combine
...
the
...
BND
...
output
...
and
...
the
...
iPOJO
...
input,
...
the
...
iPOJO
...
input
...
need
...
to
...
be
...
the
...
same
...
as
...
the
...
BND
...
file
...
but
...
with
...
the
...
".jar"
...
extension.
...
For
...
instance,
...
the
...
BND
...
file
...
is
...
foo.bnd,
...
so
...
the
...
input
...
jar
...
must
...
be
...
foo.jar.
...
To
...
be
...
sure
...
that
...
the
...
BND
...
bundle
...
is
...
already
...
created,
...
you
...
can
...
add
...
the
...
"
...
depends
...
"
...
clause
...
in
...
the
...
target
...
using
...
the
...
iPOJO
...
task
...
to
...
the
...
target
...
creating
...
the
...
bundle.
...
However,
...
it
...
is
...
possible
...
to
...
create
...
only
...
one
...
target
...
doing
...
the
...
two
...
operations
...
as:
Wiki Markup |
---|
{div:class=pom} <target name="main"> {color:red}<!-- Change to use the latest BND version -->{color} <taskdef resource="aQute/bnd/ant/taskdef.properties" {color:red}classpath="bnd-0.0.178.jar"/>{color} {color:red}<!-- Change the path to point on the iPOJO Ant task jar -->{color} <taskdef name="ipojo" classname="org.apache.felix.ipojo.task.IPojoTask" {color:red}classpath="org.apache.felix.ipojo.ant-1.6.0.jar"{color}/> <bnd classpath="src" eclipse="true" failok="false" exceptions="true" files="{color:red}foo.bnd{color}"/> <ipojo input="{color:red}foo.jar{color}" metadata = "meta.xml"/> </target> {div} h2. |
Directory
...
manipulation
...
The
...
manipulator
...
can
...
take
...
a
...
directory
...
in
...
input.
...
In
...
this
...
case,
...
classes
...
from
...
this
...
folder
...
is
...
manipulated.
...
You
...
can
...
also
...
set
...
the
...
manifest
...
file
...
location
...
too.
...
Here
...
in
...
an
...
example
...
of
...
configuration
...
using
...
this
...
mode:
Code Block | ||||
---|---|---|---|---|
| ||||
{code:xml} <target name="manipulate"> <ipojo dir="${output..}" <!-- Manipulated directory --> metadata="metadata.xml" manifest="META-INF/MANIFEST.MF" <!-- Manifest location --> /> </target> {code} {info:title=Manifest location} If not set, the manifest is searched in the given {{ |
Info | ||
---|---|---|
| ||
If not set, the manifest is searched in the given folder ( _i.e. _ {{
). {info} h2. Conclusion Subscribe to the Felix users mailing list by sending a message to [mailto: |
Conclusion
Subscribe to the Felix users mailing list by sending a message to users-subscribe@felix.apache.org
...
;
...
after
...
subscribing,
...
...
questions
...
or
...
feedback
...
to
...
...
.
Include Page | ||||
---|---|---|---|---|
|
...