Skip to content

Instantly share code, notes, and snippets.

@kevboutin
Created April 5, 2013 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevboutin/5315832 to your computer and use it in GitHub Desktop.
Save kevboutin/5315832 to your computer and use it in GitHub Desktop.
This is a custom target to use with any ant build. The idea is that this file should be included into your build script and reference the dependency target where appropriate (ex. <import file="./project.xml" /> ). This step should be used after the publish directory is loaded up with all assets and ready to be deployed/packaged. Once this target…
<target name="-tarball">
<condition property="publish.exists">
<available file="${dir.publish}" type="dir"/>
</condition>
<condition property="dist.exists">
<available file="${dir.dist}" type="dir"/>
</condition>
<if>
<equals arg1="${publish.exists}" arg2="true"/>
<then>
<echo message="Compressing release into a convenient tarball within ${dir.source}/${dir.dist}"/>
<if>
<equals arg1="${dist.exists}" arg2="true"/>
<then>
<mkdir dir="${dir.dist}"/>
</then>
</if>
<tar destfile="${dir.dist}/release.tar" basedir="${dir.publish}"
includes="*,**/*"/>
<gzip src="${dir.dist}/release.tar"
destfile="${dir.dist}/release.tar.gz"/>
<delete file="${dir.dist}/release.tar"/>
</then>
</if>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment