Our build process constructs several products out of a relatively small set of plugins. To trigger the build, we have an Ant file that just iterates through the names of the products, like so:
<for list="all,client1,client1_64,client2,client2_64,rob" param="feature">
<sequential>
<java jar="${eclipse.launcher}" fork="true" dir="${basedir}" failonerror="true">
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-buildfile" />
<arg value="${eclipse.pde.build}/scripts/productBuild/productBuild.xml" />
<arg value="-DbaseLocation=${eclipse.dir}" />
<arg value="-Dproduct=${feature.dir}/@{feature}/my.product" />
<arg value="-DbuildLabel=@{feature}-${build.timestamp}" />
<arg value="-DbuildId=My_@{feature}_${release.name}-${build.timestamp}" />
<arg value="-Dtimestamp=${release.name}-${build.timestamp}" />
<arg value="-DbuildDirectory=${build.dir}" />
</java>
</sequential>
</for>
Not surprisingly perhaps, the 'all' product includes every one of our plugins, the others some subset. My problem is that each iteration through this loop recompiles and packages every plugin, throwing out work that was done previously. Not a big deal at a couple of products, but now most of our build time is spent recompiling and packaging plugins.
Can someone point me to a better way of making the build process build plugins only once as all these products are packaged?
Since the "all" product includes everything, I would suggest breaking it out separate from the other products.
Once the "all" product is built, you can take the output of that and make it available to the other product builds. If your "all" product build is producing p2 metadata, you can use repoBaseLocation and transformedRepoLocation, otherwise you can use pluginPath
.
For the subsequent product builds, use a new empty buildDirectory
so that they don't see the source for the bundles, only the binary output from the "all" product. If everything these products need is available in binary form, then no compilation will be necessary and these builds essentially become packaging operations.