Ant is a simple open-source scripting engine that is capable of running scripts written in XML format. Ant is ideal for executing tasks usually found in automated builds.
The variables set in the plug-in, fragment or feature build.properties will be used by automated build scripts for Ant. PDE generates Ant scripts for creating individual plug-in and fragment build files and one overall script for building the feature JAR. This "main" script is also responsible for running individual script files in the right order (defined by the plug-in dependency chain). Each build file has the same name (build.xml) and is created as a sibling of the manifest files in the corresponding projects.
Since Ant scripts use the replacement variables in build.properties, you can typically use them "as is," without modifying the generated scripts. If you do modify them, you must not recreate the scripts every time you want to rebuild the component. For this reason, script generation and execution can be individually controlled.
To create scripts, you can simply press the button Package... in the feature manifest. If the manifest is not open, you can select the manifest file and select Create Feature JAR from the popup menu (similar command exists for plug-in and fragment manifests). The command will generate the build script and open Ant wizard to execute it:
The standard Ant wizard allows customization in two ways: by providing the execution arguments and by selecting one or more build targets.
Ant arguments are typically used to provide property values that override default values and control the build process. Arguments are set using "-Dproperty=value". The following properties are recognized:
bootclasspath - if set, it replaces the default boot classpath. Used when compiling cross-platform plug-ins (e.g. building a UI plug-in for Windows using Linux)
When executing feature build scripts, the following targets are used to call individual targets of plug-ins or fragments. In order to specify what target to execute, the property target should be set (e.g. -Dtarget=refresh):
In this scenario, one of the all.* targets serves as iterator, whereas the actual target to execute is specified via the property target as shown above.
The following targets build JARs and sources for all feature children:
Target build.update.jar can be selected to generate a feature JAR in the format used by the install/update mechanism. The above mentioned property feature.destination can be used to define where to put the JAR and plugin.destination controls where to put individual update JARs for plug-ins and fragments.
Target zip.distribution creates a zip file with the feature and its plug-ins and fragments in an SDK-like structure but does not include source code. Source can be generated with the zip.sources target.
Use clean target to delete everything produced by running any of the targets. Finally, the refresh target performs a "Refresh" action in the current project, thus making the newly generated resources visible in the Navigator or Package Explorer.
When executing build scripts for individual plug-ins and fragments, an additional target called zip.plugin can be used. It creates a zip file with the binary and source contents of a plug-in with the following structure:
id_version/
contents
where 'id' is the plug-in unique identifier and 'version' is the plug-in version. This zip file can be directly unzipped into the Eclipse installation directory as a form of a quick manual deployment.