I got ant script running fine inside Eclipse Here is a piece of it :
<p2.composite.repository failOnExists="true">
<repository location="file:/${basedir}/compRepo" name="Repository description goes here" />
<add>
<repository location="http://url/Eclipse/repo/Galileo-3.5.1/" />
<repository location="http://another-url/Java/repo/4.0/" />
<repository location="${diag.location}" />
</add>
</p2.composite.repository>
But I would like Hudson CI server to be able to run it, but, no matter all the jars I put in ANT_HOME/lib I can't get this task to run in a simple command line ant... I got stuck with this error :
C:\workspaces\workspace\project\junit.script\createCompRepo.xml:10: Problem: failed to create task or type p2.composite.repository
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
Where are defined the p2 ant tasks ? Is there a way to run them outside Eclipse ? Thank you very much for you help ! Anthony
Just to complete the example of Jarek Przygódzki here is my solution, using his ant-file. I'm not well versed in using ant, so there might be potential for optimisation. This aproach is used headless on a server without GUI, nevertheless I had to install eclipse. Installation with apt-get wasn't working, so it's better to install manual (download and untar).
First antfile:
Second Antfile, named addCompositeInternal.ant
I created a small Ant macro for that exact purpose
By reading this thread and the P2 Publisher documentation, it should be in
org.eclipse.equinox.launcher_*.jar
Example of a P2 task (not an ant task here) just for the
-jar
argument:The P2 Ant tasks are described here, and in the Eclipse help.
The OP Anthony43 adds in the comments:
But Andrew Niefer (Eclipse committer on PDE/Build, p2, & Equinox Framework) adds:
martin jakubik mentions:
All the p2 tasks NEED the eclipse runtime (as explicitly stated in the eclipse help mentioned above), so you definitely need to use eclipse.
The only way to get round of it would be to analyze the eclipse code, extract what is needed and create your own build system with it.