Skip to content

Instantly share code, notes, and snippets.

@abego
Created May 15, 2012 08:53
Show Gist options
  • Select an option

  • Save abego/2700168 to your computer and use it in GitHub Desktop.

Select an option

Save abego/2700168 to your computer and use it in GitHub Desktop.
Ant build file for Java2Script annotations/tags library
<?xml version="1.0"?>
<project name="j2stags" default="dist" basedir=".">
<description>
The Java2Script annotations (like @J2SRequireImport, ...)
</description>
<!-- set global properties for this build -->
<property name="version" value="2.0.0-20100601-eclipse-3.6"/>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<target name="init">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" includeantruntime="false" />
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Put everything in ${build} into the j2stags-${version}.jar file -->
<jar jarfile="${dist}/j2stags-${version}.jar" basedir="${build}"/>
<!-- Put "source files" into the j2stags-${version}-src.zip file -->
<zip destfile="${dist}/j2stags-${version}-src.zip" >
<zipfileset dir="${basedir}" prefix="j2stags-${version}-src"
includes="**/*.java, build.xml"/>
</zip>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment