Most of this post contains same info as the eclipse help page with same heading.
Creating a product configuration file is easy. Check the eclipse help page explains it well. Assuming the our product config example.product looks like this and resides in a plug-in com.example.product.
Basic Setup
We will need 3 directory paths
- where the features and plug-ins to be build will reside. We will call it buildDirectory.
- where the build configuration file (build.properties) will reside. We will call it buildConfiguration.
- where the eclipse installation resides. We will call it baseLocation.
Now to prepare these directories
- Copy the features and plug-ins in side the buildDirectory. Ideally this will be a source checked out from the version control system. Custom ant tasks can be used to automate that. For this example, the directory shall look like this
- Copy build.properties file from baseLocation/plugins/org.eclipse.pde.build_<version>/templates/headless-build to buildConfiguration folder. This file will configure the build and the output.
- Now we need to edit this build.properties file and fill in the parameters
- product=C:/build/buildDirectory/plugins/com.example.product/example.product This entry shall point to the product configuration file. The features/plugins mentioned in this file will only be picked for the build but searched in buildDirectory and baseLocation.
- archivePrefix=HelloWorld The archivePrefix is the name of the Folder under which the product will reside.
- configs=win32, win32, x86 The configs shall point to the platforms for which product has to be build. The eclipse mentioned at baseLocation should have RCP Delta Pack. Without the delta pack, the build wont be able to create product for other platforms. Also, when troubleshooting for missing config or launch files, ensure that right version of delta pack is installed.RCP Delta Pack is build along with SDK so the same version shall be used. I am building only for windows that is that the configs entry is for only win32. For building other platforms, uncomment the required platforms. The platforms are delimited using & \.
- buildDirectory=C:/build/buildDirectory This will the buildDirectory we setup above.
- buildType=I I is for Integration build, N for Nightly, M for Milestone, S for ...I dunno. But you got the point.
- buildId=ExampleProductBuild This will name the build archive.
- base=C:/
baseLocation=${base}/eclipse
The base is the location which contains the eclipse installation (with RCP Delta Pack).
<buildDirectory> plugins/ com.example.helloworld com.example.product example.product features/ com.example.helloworld.feature
The build will be invoked as before
java -jar <eclipse-installation-path>\plugins\org.eclipse.equinox.launcher_<version><qualifier>.jar -application org.eclipse.ant.core.antRunner -buildfile <eclipse-installation-path>\plugins\org.eclipse.pde.build_<version><qualifier>\scripts\productBuild\productBuild.xml -Dbuilder=c:\build\buildConfiguration
example
java -jar c:\eclipse\plugins\org.eclipse.equinox.launcher_1.1.0.v20100507.jar -application org.eclipse.ant.core.antRunner -buildfile c:\eclipse\plugins\org.eclipse.pde.build_3.6.0.v20100603\scripts\productBuild\productBuild.xml -Dbuilder=c:\build\buildConfiguration
The output will look like this
I.ExampleProductBuild
│ ExampleProductBuild-win32.win32.x86.zip
│
└───compilelogs
└───plugins
└───com.example.helloworld_1.0.0.201007191243
@dot.log
The folder I.ExampleProductBuild will contain the build logs and the product build ExampleProductBuild-win32.win32.x86.zip. If we had chosen other configs they too will appear here in separate zip (or whichever format we specify).