Skip to content

Instantly share code, notes, and snippets.

@butlermh
Created June 8, 2011 14:50
Show Gist options
  • Save butlermh/1014571 to your computer and use it in GitHub Desktop.
Save butlermh/1014571 to your computer and use it in GitHub Desktop.
Using uptodate to speed up builds
<target name="check.retrieve.necessary" description="Only retrieve jars with Ivy if necessary">
<ivy:resolve file="${ivy.file}" transitive="true"/>
<uptodate property="libs.uptodate">
<srcfiles dir="." includes="${ivy.file}"/>
<mapper type="merge" to="{lib.dir}/.done"/>
</uptodate>
</target>
<target name="resolve" depends="check.retrieve.necessary" description="--> resolve and retrieve dependencies with ivy"
unless="libs.uptodate">
<delete includeemptydirs="true" dir="${lib.dir}"/>
<mkdir dir="${job.lib.dir}"/> <!-- not usually necessary, ivy creates the directory IF there are dependencies -->
<mkdir dir="${test.lib.dir}"/>
<ivy:retrieve pattern="${job.lib.dir}/[artifact]-[revision].[ext]" conf="job" />
<ivy:retrieve pattern="${test.lib.dir}/[artifact]-[revision].[ext]" conf="test" />
<touch file="${lib.dir}/.done" />
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment