Wednesday, January 23, 2008

Examples of using PDE/Build

It can be very useful to have an example when setting up your first headless build. It occurs to me that there is a growing number of relatively simple examples: the pde.build junit tests.

The org.eclipse.pde.build.tests project can be checked out of cvs from dev.eclipse.org/cvsroot/eclipse/org.eclipse.pde.build.tests. The main test suite is PDEBuildTestSuite.

If you run the tests with the vm argument pde.build.noCleanup=true then the tests will run without deleting any files and you can then go take a look at the setup for each test.

Not every test is a full build, but many are. Generally the tests consist of generating some features and plugins, then generating the build.properties and allElements.xml configuration files and then running the build.

Of particular interest would be the generation of the build.properties file. This is done by loading the template file and then setting just a handful of the properties. See BuildConfiguration.getBuilderProperties(IFolder). This should give a good idea of what properties you need to change for your build.

*Edit 1/28/08 : The "pde.build.noCleanup" argument was added on 1/23/08, you must use a build N20080124-0010 or newer. The first I-Build containing these changes will be I20080129.

1 comment:

Anuerin said...

it would be nice if the Eclipse PDE distribution (or the wiki) would host a cheat sheet or a step-by-step instructions for setting up a headless build. i am reading at the documentation and feeling more stupid every minute because i can't even generate the build.xml files from command line as every plugin is being resolved to a verion 0.0.0.

reading the posts in the newgroup is not much help in reducing the aggravation as their results show that the proper version is being resolved. :(

i swear if i can make this work i will write one with the hope that at least somebody out there who is as dumb as me can save some hair and teeth. :(

ciao!