如何使后续的PDE产品构建不重建依赖插件
我们的构建过程使用相对较小的一组插件构建了多个产品。为了触发构建,我们有一个 Ant 文件,它只迭代产品的名称,如下所示:
<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>
毫不奇怪,“所有”产品包括我们的每一个插件,其他一些子集。我的问题是,这个循环的每次迭代都会重新编译和打包每个插件,从而丢弃之前完成的工作。对于一些产品来说这没什么大不了的,但现在我们的大部分构建时间都花在了重新编译和打包插件上。
有人可以向我指出一种更好的方法,使构建过程只构建插件一次,因为所有这些产品都已打包吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于“所有”产品包括所有内容,我建议将其与其他产品分开。
一旦构建了“所有”产品,您就可以获取该产品的输出并将其提供给其他产品构建。如果您的“所有”产品版本正在生成 p2 元数据,您可以使用 repoBaseLocation 和 returnedRepoLocation,否则您可以使用
pluginPath
。对于后续产品构建,请使用新的空
buildDirectory
,这样他们就看不到捆绑包的源代码,只能看到“所有”产品的二进制输出。如果这些产品所需的一切都以二进制形式提供,那么就不需要编译,并且这些构建本质上成为打包操作。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.我无法让
pluginPath
工作,所以我所做的是将已经构建的插件复制到 Eclipse 目标的“dropins”文件夹中。 PDE 会自动拾取它们并且不会重建它们。I couldn't get
pluginPath
to work, so what I did was to copy the already-built plugins into the "dropins" folder of the Eclipse target. PDE picks them up automatically and doesn't rebuild them.