Building jars headless [message #521977] |
Fri, 19 March 2010 09:37 |
Eclipse User |
|
|
|
I'm struggling to create a jar file with a jardesc automatically. Here's
what I did.
1. I've created a jardesc file. Right-clicking it and choosing "Create
JAR" works fine. So far, so good.
2. I want this jar to be recreated each time my project is built, so
I've added an Ant builder to my project. I've struggled to find an Ant
task that produces a jar from the jardesc but couldn't find anything
like it. I didn't want to copy every jar-creation parameter in a <jar>
ant task, as this would duplicate the information already in the jardesc
file, so I wrote a simple custom Ant task that fires the action
associated with the Create Jar menu item, given a jardesc file. This
works, but I feel this is way too complicated for what it does --
creating a jar. Any better way to do this?
3. Finally, I now want to create this jar as part of a headless build.
It looks like the org.eclipse.ant.core.antRunner application is meant
for this, so I tried something like
java -cp org.eclipse.equinox.launcher_<version>.jar
org.eclipse.equinox.launcher.Main -data path/to/workspace -application
org.eclipse.ant.core.antRunner -buildfile
path/to/workspace/<projectname>/build.xml
And this fails, because my custom task that builds the jar from the
jardesc needs to load classes from org.eclipse.ui, and they seem to be
unavailable in headless mode.
Questions: 1. Any way to produce an automatic build with the full
eclipse (so, not headless), so that the jar can be created with my
custom task? 2. Any easier way to do this whole thing? Get rid of the
jardesc altogether and use only plain ant files?
Any help much appreciated.
TIA,
J.-P.
|
|
|
Powered by
FUDForum. Page generated in 0.02856 seconds