Aakash
Aakash

Reputation: 329

Invoking Eclipse's export to xml programatically

I want to invoke the export to xml function of eclipse programatically to create the build.xml files, so that it can be in a continuous integration process.

Is there an easy way to do it, without opening Eclipse?

Thanks, Aakash

Upvotes: 0

Views: 682

Answers (1)

Andrew Niefer
Andrew Niefer

Reputation: 4309

org.eclipse.pde.build contributes an ant task "eclipse.buildScript" which generates the build.xml scripts that are using in export and headless pde builds.

There are quite a few properties that serve as inputs to this task. The simplest way to call it directly from the command line would be something like:

eclipse -application org.eclipse.ant.core.antRunner -f plugins/org.eclipse.pde.build_3.5.0.v20090521-1730/scripts/genericTargets.xml generateScript

You would also need to pass a bunch of -Dproperty=value arguments to set the input properties. It might be simpler to write a wrapper build.xml script that you would run using the antRunner, in that case, the genericTargets.xml script would be located at ${eclipse.pdebuild.scripts}/genericTargets.xml.

There is some documentation on the task here. This is used as part of the larger automated build support provided by pde.build, docs for that start here.

Upvotes: 1

Related Questions