Creating Headless Automated Eclipse Builds
To follow these instructions, ensure that you are on the
Builds application by choosing the "Builds" icon from the very top Navigation Bar.
Zed Builds And Bugs
has several powerful features that make the process of building Eclipse features and Eclipse Update Sties very easy. We'll document in this HowTo guide exactly what you'll need to do to get up and running quickly.
Prerequisites
In order to most easily fit into this process, it's beneficial to follow a few guidelines about creating plugins for eclipse:
- Create a Feature for your plugins. This is the best way to organize and give yourself a single starting point for your build.
- Manage your plugin dependencies properly. Use the eclipse plugin dependencies instead of hard-coding classpath settings, so that the eclipse build system will be able to auto-resolve your plugin build requirements.
Eclipse Feature Build Step
With your Eclipse plugins organized into features, simply add a new Eclipse Feature Build step to your build definition:
On this screen, provide the following:
- Feature Name This is the name of your Eclipse feature.
- Eclipse Base Dir This is the directory where the Eclipse installation lives. We'll use this Eclipse installation to manage the build of your feature, so any dependencies should be present within this Eclipse installation.
- Generate build.xml Files Zed will handle generating all of the Ant build.xml files for you so that your feature is compiled properly. If you have customized these build.xml files, you can turn this option off so that Zed will not overwrite your files.
- Standard Targets There are several standard targets provided with the generated Ant build.xml files. Each of these is displayed here with a checkbox to let you turn these targets on or off. At a minimum you will probably need build.jars and either build.update.jar (for an eclipse update site) or zip.distribution (for a CD distribution of your product).
- Custom Targets This allows you to add in any extra Ant build targets that you would like the compile to include. These will be added after the Standard Targets that are referenced.
- Update build.xml Files The generated build.xml files have some settings that we consider sub-optimal. The defaults generated for this build step will help you to adjust those settings. This will do a standard Search & Replace for all build.xml and MANIFEST.MF files within your feature project and dependent plugins.
Once you have defined these settings, save the build step, and your build is ready to run.
Eclipse Update Site
The second half of building an Eclipse Feature project is usually deploying the packaged jars into an Update Site so that you can share the project with those who will be using it. Zed Builds And Bugs
also makes this step easy.
Use the Build Step context menu and choose a new Eclipse Update Site step:
This step looks similar to the Eclipse Feature Build above, but is targeted to help you create your update site quickly and easily. Fill in the following fields:
- Feature Name This is the Eclipse feature that you would like to copy to an eclipse update site. It must have already been compiled correctly.
- Feature Category This is the name of your Feature Category and will be added to your site.xml file.
- Description This describes your Feature Category and will be added to your site.xml file.
- Update Site Root This is the full path to your eclipse update site. You may use build replacement variables for this setting.
- Create If Missing If the path defined by the Update Site Root field is missing, the Zed server will attempt to create it.
- Delete Update Site Contents Before Deploying If you are not sharing your update site folder with other projects, this can be a good way of ensuring that only the latest compiles are published to the update site.
- Site Description This is the overall description of your Eclipse update site. It will be set in the site.xml file.
- Error if Include Plugins Missing This allows you to trigger a build step error if any of the plugins defined by your Feature are missing. Sometimes you don't want this, and want to allow your Feature to be published even if some of the included features are missing.
- Error if Included Features Missing Eclipse Features can reference other Features. When this happens, a dependency chain is built up for each referenced feature. This option allows you to cause the build step to fail if anything in the dependency chain is missing. Sometimes you want to allow for missing features, though, and this option gives you that capability.
- Extra Files to Copy Sometimes you have files or plugins that you would also like to have copied over to the update site. This area gives you a free-form list of items that you would also like to have included in the copy process to build your update site.
Once you have finished defining the layout of your update site, save the build step, and your build will automatically create an Eclipse update site for you every time it runs.
The eclipse ant build framework does include tasks that allow you to use the built in eclipse support for CVS to allow you to download your source code from a CVS repository. The disadvantage of this is that it won't support all types of source control management systems, like Perforce
, ClearCase
, etc. We recommend splitting this step out, even if you are using CVS, because it gives you better visibility into the steps that are performed by your build, and it gives you more flexibility over the underlying source control systems that you can incorporate.