>Use PDE Ant Tasks without running eclipse

>In continuing my experimentation with the PDE Build Ant Tasks, it appears as though you can use those with out actually having to run eclipse. There are a couple of items that you will probably need to do to get them to work:

  1. As stated with the Ant4Eclipse post, you’ll need to include the appropriate osgi runtime jar.
  2. Along with that you’ll need org.eclipse.core.runtime
  3. Also the jar file from org.eclipse.pde.build/lib. You’ll find the later in your plugins directory.
  4. You’ll want to create a taskDef file that has the necessary tasks defined. These are items like eclipse.generateFeature, eclipse.buildScript. The task defs should point to the appropriate classes. i.e. org.eclipse.pde.internal.build.tasks.BuildScriptGeneratorTask for the eclipse.buildScript task.

Theoretically, since eclipse bundles are just jar files, they can be used outside of eclipse. With the appropriate setup, you can then run a build with out having to actually launch eclipse to launch ant. You can have Ant use the build scripts with out needing eclipse.

I still need to test this, and some additional jars may be necessary, but from what I can tell at least 90% of the tasks don’t rely specifically on eclipse resources, except for the CoreRuntime exception class.

This entry was posted in agile, eclipse, release engineering. Bookmark the permalink.

4 Responses to >Use PDE Ant Tasks without running eclipse

  1. >I’m not sure, I understand the purpose of using pde ant tasks. PDE build generates an ant build script that uses these tasks.Is there a reason why I’d use these tasks outside of PDE build ?

  2. David Carver says:

    >Mainly so that you didn’t need to launch a eclipse in headless mode, to build the plugins, features, and products. One of the reasons that eclipse is launched headless for automated builds, is that these tasks are only available within an eclipse instance, because no appropriate taskdef.xml file was created to allow them to be run outside. Being able to run a build for eclipse without adding the overhead and memory requirements of launching eclipse in headless mode, can be of some benefit.Particularly if you have a customized version of the build scripts that don’t necessarily use the Map files, and other PDE build specific features for retrieving the files. I happen to use Luntbuild, which handles much of the management of getting the appropriate source code out.PDE Build assumes a certain way of doing things. And various pieces of PDE Build make it easy to use, but other pieces make it more difficult to consume outside of the predefined scenarios.

  3. >Have you made any progress on this? Is there really a way to use the PDE tasks without a headless Eclipse?

  4. David Carver says:

    >The answer is yes and no.The ant tasks could be made to not depend on eclipse, or just depend on a few specific jars. I haven’t had time to explore this much beyond a rudimentary test. For compilation of Features and Plugins, I’d suggest taking a look at the Ant4Eclipse sourceforge project. In a lot of ways it seems much more straight forward than PDE Build.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s