Avoiding re-building prerequisites in Ant

时间秒杀一切 提交于 2019-12-05 17:05:44

This conditional compilation of a large build is a feature of make that I initally missed in ANT. Rather than use target dependencies, I'd suggest dividing your large project into smaller modules, each publishing to a common shared repository.

Ivy can then be used to control the component versions used by the main module of the project.

<ivy-module version="2.0">
    <info organisation="com.myspotontheweb" module="multi_module_project"/>
    <publications>
        <artifact name="main" type="jar"/>
    </publications>
    <dependencies>
        <dependency org="com.myspotontheweb" name="component1" rev="latest.integration"/>
        <dependency org="com.myspotontheweb" name="component2" rev="latest.integration"/>
        <dependency org="com.myspotontheweb" name="component3" rev="latest.integration"/>
        <dependency org="com.myspotontheweb" name="component4" rev="latest.integration"/>
    </dependencies>
</ivy-module>

The ivy:retrieve task will only download/copy one of the sub-modules if they have changed (published from their build files)

It all sounds more complicated but maybe you're already sub-dividing the project within your build file.... For example, if your ANT uptodate task is being made dependent on one the build artifacts.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!