blob: 7917f93162b9d7ba475b07cb700be611d9344b98 [file] [log] [blame]
Clement Escoffier6b928e92008-05-16 20:33:54 +00001
2<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<HTML>
4
5
6<HEAD>
7 <TITLE>Apache Felix - iPOJO Ant Task</TITLE>
8 <LINK rel="stylesheet" href="http://felix.apache.org/site/media.data/site.css" type="text/css" media="all">
9 <META http-equiv="Content-Type" content="text/html;charset=UTF-8">
10 </HEAD>
11 <BODY>
12 <DIV class="title"><DIV class="logo"><A href="http://felix.apache.org/site/index.html"><IMG border="0" alt="Apache Felix" src="http://felix.apache.org/site/media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="http://felix.apache.org/site/media.data/apache.png"></A></DIV></DIV>
13 <DIV class="menu">
14 <UL>
15 <LI><A href="http://felix.apache.org/site/news.html" title="news">news</A></LI>
16 <LI><A href="http://felix.apache.org/site/license.html" title="license">license</A></LI>
17 <LI><SPAN class="nobr"><A href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
18 <LI><A href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</A></LI>
19 <LI><A href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</A></LI>
20 <LI><A href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</A></LI>
21 <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
22 <LI><SPAN class="nobr"><A href="http://www.apache.org/foundation/sponsorship.html" title="Visit page outside Confluence" rel="nofollow">sponsorship<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
23 <LI><SPAN class="nobr"><A href="http://www.apache.org/foundation/thanks.html" title="Visit page outside Confluence" rel="nofollow">sponsors<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN>
24<!-- ApacheCon Ad -->
25<IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME>
26<P style="height: 100px">
27<!-- ApacheCon Ad --></LI>
28</UL>
29 </DIV>
30 <DIV class="main">
31<TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR>
32<TD class="confluenceTd" valign="top" width="80%">
33<H1><A name="iPOJOAntTask-IPOJOAntTask"></A>IPOJO Ant Task</H1>
34
35<P>IPOJO Ant Task allows automating the iPOJO manipulation process. This page explains how to use the iPOJO Ant Task and how to combine them with the BND Tasks.</P>
36
37<H2><A name="iPOJOAntTask-DownloadingtheiPOJOAntTask"></A>Downloading the iPOJO Ant Task</H2>
38
39<P>The iPOJO Ant Task can ben downloaded from <A href="http://felix.apache.org/site/download.html" title="Download">here</A>.</P>
40
41<H2><A name="iPOJOAntTask-HowtousetheAntTask"></A>How to use the Ant Task</H2>
42
43<P>The iPOJO Ant task take an input bundle and a metadata file and create the final (i.e. manipulated) bundle.<BR>
44To use the task declare a target in your build.xml as:</P>
45<DIV class="panel"><DIV class="panelContent">
46<P>&lt;target name=&quot;main&quot;&gt;<BR>
47&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;taskdef name=&quot;ipojo&quot; classpath=&quot;org.apache.felix.ipojo.ant-0.8.0-SNAPSHOT.jar&quot; classname=&quot;org.apache.felix.ipojo.task.IPojoTask&quot;/&gt; <FONT color="red">&lt;!---Change the path to point on the iPOJO Ant task jar --&gt;</FONT><BR>
48&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ipojo<BR>
49&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input=&quot;foo.jar&quot;<BR>
50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; metadata = &quot;meta.xml&quot;<BR>
51&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt;<BR>
52&lt;/target&gt;</P>
53</DIV></DIV>
54<P>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.</P>
55
56<H2><A name="iPOJOAntTask-AntTaskArguments"></A>Ant Task Arguments</H2>
57
58<P>The iPOJO Ant Task as three different arguments:</P>
59<UL>
60 <LI>Input: describes the input bundle. This argument is mandatory.</LI>
61 <LI>Output: describes the output bundle. This argument is optional. If not present, the output file will be input file.</LI>
62 <LI>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.</LI>
63 <LI>IgnoreAnnotations: if set to &quot;true&quot;, the manipulator skips annotations processing.</LI>
64</UL>
65
66
67<H2><A name="iPOJOAntTask-CombiningtheiPOJOAntTaskandBND"></A>Combining the iPOJO Ant Task and BND</H2>
68
69<P>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.</P>
70<DIV class="panel"><DIV class="panelContent">
71<P>&lt;project default=&quot;main&quot; basedir=&quot;.&quot;&gt;<BR>
72&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;target name=&quot;bnd&quot;&gt;<BR>
73&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;taskdef resource=&quot;aQute/bnd/ant/taskdef.properties&quot;<BR>
74&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;classpath=&quot;bnd-0.0.178.jar&quot;/&gt; <FONT color="red">&lt;!-- Change to use the latest BND version --&gt;</FONT><BR>
75&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &lt;bnd<BR>
76&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; classpath=&quot;src&quot;<BR>
77&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eclipse=&quot;true&quot;<BR>
78&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; failok=&quot;false&quot;<BR>
79&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exceptions=&quot;true&quot;<BR>
80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color="red">files=&quot;foo.bnd&quot;</FONT>/&gt;<BR>
81&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;/target&gt;&nbsp;&nbsp;&nbsp;&nbsp;</P>
82
83<P>&nbsp;&lt;target name=&quot;main&quot; depends=&quot;bnd&quot;&gt;<BR>
84&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;echo message=&quot;Call main&quot;/&gt;<BR>
85&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;taskdef name=&quot;ipojo&quot; classpath=&quot;org.apache.felix.ipojo.ant-0.8.0-SNAPSHOT.jar&quot; classname=&quot;org.apache.felix.ipojo.task.PojoTask&quot;/&gt; <FONT color="red">&lt;!---Change the path to point on the iPOJO Ant task jar --&gt;</FONT><BR>
86&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ipojo<BR>
87&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color="red">input=&quot;foo.jar&quot;</FONT><BR>
88&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; metadata = &quot;meta.xml&quot;<BR>
89&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /&gt;<BR>
90&lt;/target&gt;<BR>
91&lt;/project&gt;</P>
92</DIV></DIV>
93<P>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 &quot;.jar&quot; extension. For instance, the BND file is foo.bnd, so the input jar must be foo.jar.<BR>
94To be sure that the BND bundle is already created, you can add the &quot;<EM>depends</EM>&quot; clause in the target using the iPOJO task to the target creating the bundle.</P>
95
96<P>However, it is possible to create only one target doing the two operations as:</P>
97<DIV class="panel"><DIV class="panelContent">
98<P>&lt;target name=&quot;main&quot;&gt;<BR>
99&nbsp;&nbsp;&lt;taskdef resource=&quot;aQute/bnd/ant/taskdef.properties&quot;<BR>
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;classpath=&quot;bnd-0.0.178.jar&quot;/&gt; <FONT color="red">&lt;!-- Change to use the latest BND version --&gt;</FONT><BR>
101&nbsp;&nbsp;&lt;taskdef name=&quot;ipojo&quot; classpath=&quot;org.apache.felix.ipojo.ant-0.8.0-SNAPSHOT.jar&quot; classname=&quot;org.apache.felix.ipojo.task.IPojoTask&quot;/&gt; <FONT color="red">&lt;!---Change the path to point on the iPOJO Ant task jar --&gt;</FONT><BR>
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;bnd<BR>
103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; classpath=&quot;src&quot;<BR>
104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eclipse=&quot;true&quot;<BR>
105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; failok=&quot;false&quot;<BR>
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exceptions=&quot;true&quot;<BR>
107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; files=&quot;foo.bnd&quot;/&gt;<BR>
108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ipojo<BR>
109&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input=&quot;foo.jar&quot;<BR>
110&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; metadata = &quot;meta.xml&quot;/&gt;<BR>
111&lt;/target&gt;</P>
112</DIV></DIV>
113<H2><A name="iPOJOAntTask-Conclusion"></A>Conclusion</H2>
114
115<P>Subscribe to the Felix users mailing list by sending a message to users-subscribe@felix.apache.org; after subscribing, email questions or feedback to users@felix.apache.org.</P>
116</TD>
117<TD class="confluenceTd" valign="top" width="20%">
118<FORM method="get" class="confluence-searchbox marginlessForm " action="http://felix.apache.org/confluence/dosearchsite.action">
119 <INPUT type="hidden" name="searchQuery.spaceKey" value="FELIX">
120 <INPUT type="text" name="searchQuery.queryString">
121 <INPUT type="submit" value="Search">
122</FORM>
123<HR>
124<H6><A name="iPOJOAntTask-Overview"></A><B>Overview</B></H6>
125<UL>
126 <LI><A href="http://felix.apache.org/site/apache-felix-ipojo.html" title="Apache Felix iPOJO">Home Page</A></LI>
127 <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI>
128 <LI><A href="http://felix.apache.org/site/download.html" title="Download">Download &amp; Install </A></LI>
129</UL>
130
131
132<H6><A name="iPOJOAntTask-GettingStarted"></A><B>Getting Started</B></H6>
133<UL>
134 <LI><A href="http://felix.apache.org/site/ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI>
135 <LI><A href="http://felix.apache.org/site/ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word &#40;Maven&#45;Based&#41; tutorial</A></LI>
136 <LI><A href="http://felix.apache.org/site/ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI>
137</UL>
138
139
140<H6><A name="iPOJOAntTask-UserGuide"></A><B>User Guide</B></H6>
141<UL>
142 <LI><A href="http://felix.apache.org/site/describing-components.html" title="Describing components">Describing components</A></LI>
143 <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI>
144 <LI><A href="http://felix.apache.org/site/ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI>
145 <LI><A href="http://felix.apache.org/site/ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI>
146</UL>
147
148
149<H6><A name="iPOJOAntTask-Tools"></A><B>Tools</B></H6>
150<UL>
151 <LI><A href="http://felix.apache.org/site/ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug&#45;in</A></LI>
152 <LI><A href="#" title="iPOJO Ant Task">iPOJO Ant Task</A></LI>
153 <LI><A href="http://felix.apache.org/site/ipojo-maven-plug-in.html" title="iPOJO Maven Plug-in">iPOJO Maven Plug&#45;in</A></LI>
154 <LI><A href="http://felix.apache.org/site/ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI>
155</UL>
156
157
158<H6><A name="iPOJOAntTask-DeveloperGuide"></A><B>Developer Guide</B></H6>
159<UL>
160 <LI><A href="http://felix.apache.org/site/how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI>
161 <LI><A href="http://felix.apache.org/site/how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI>
162</UL>
163
164
165<H6><A name="iPOJOAntTask-Misc%26Contact"></A><B>Misc &amp; Contact</B></H6>
166<UL>
167 <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI>
168 <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedvms.html" title="apache-felix-ipojo-supportedVMs">Supported JVMs</A></LI>
169 <LI><A href="http://felix.apache.org/site/apache-felix-ipojo-supportedosgi.html" title="apache-felix-ipojo-supportedOSGi">Supported OSGi Implementations</A></LI>
170 <LI><A href="http://felix.apache.org/site/future-ideas.html" title="Future Ideas">Future Ideas</A></LI>
171 <LI><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=FELIX&amp;title=Contact&amp;linkCreation=true&amp;fromPageId=82824" title="Create Page: Contact" class="createlink">Contact<SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/plus.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI>
172 <LI><A href="http://felix.apache.org/site/related-works.html" title="Related Works">Related Works</A></LI>
173 <LI><A href="http://felix.apache.org/site/article-presentations.html" title="Article & Presentations">Article &amp; Presentations</A></LI>
174</UL>
175
176
177<HR>
178<DIV class="" align="center">
179<P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&amp;statuses=created&amp;statuses=modified&amp;spaces=FELIX&amp;labelString=iPOJO&amp;rssType=atom&amp;maxResults=10&amp;timeSpan=5&amp;publicFeed=true&amp;title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="http://cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="http://cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></P></DIV></TD></TR></TBODY></TABLE>
180 </DIV>
181 </BODY>
182
183
184</HTML>