Skip to content

Instantly share code, notes, and snippets.

@butlermh
Created June 8, 2011 14:55
Show Gist options
  • Save butlermh/1014576 to your computer and use it in GitHub Desktop.
Save butlermh/1014576 to your computer and use it in GitHub Desktop.
Using uptodate to speed up builds 2
<target name="compile" depends="resolve" description="--> compile the project" unless="module.uptodate">
<mkdir dir="${classes.dir}" />
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="lib.path.id" debug="true" includeantruntime="false"/>
</target>
<target name="jar" depends="version, compile, copyclasses" description="--> make a jar file for this project" unless="module.uptodate">
<jar destfile="${jar.file}">
<fileset dir="${classes.dir}" />
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Build-Version" value="${version}" />
</manifest>
</jar>
</target>
<target name="check.if.module.build.necessary">
<uptodate property="module.uptodate">
<srcfiles dir="." includes="ivy.xml"/>
<srcfiles dir="${src.dir}" includes="**/*.java"/>
<srcfiles dir="." includes="build.xml"/>
<srcfiles dir="." includes="build.properties"/>
<srcfiles dir="../../common" includes="common.xml"/>
<srcfiles dir="../../common" includes="build.properties"/>
<mapper type="merge" to="${jar.file}"/>
</uptodate>
<property name="libs.uptodate" value="${module.uptodate}"/>
<echo message="${libs.uptodate}"/>
</target>
<target name="publish-local" depends="check.if.module.build.necessary, local-version, jar" description="--> publish this project in the local ivy repository"
unless="module.uptodate">
<ivy:publish artifactspattern="${build.dir}/[artifact].[ext]"
resolver="local"
pubrevision="${version}"
pubdate="${now}"
status="integration"
forcedeliver="true"
/>
<echo message="project ${ant.project.name} published locally with version ${version}" />
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment