Skip to content

Instantly share code, notes, and snippets.

@barnash
Created July 31, 2010 08:05
Show Gist options
  • Save barnash/501920 to your computer and use it in GitHub Desktop.
Save barnash/501920 to your computer and use it in GitHub Desktop.
<project name="myproject" default="dist" basedir=".">
<property name="src.dir" value="src" />
<property name="build.dir" value="build" />
<property name="dist.dir" value="dist" />
<path id="project.classpath">
<pathelement location="${build.dir}"/>
</path>
<target name="compile" description="Compile the project">
<mkdir dir="${build.dir}" />
<javac destdir="${build.dir}" srcdir="${src.dir}" debug="true">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="dist" depends="compile" description="Make a JAR file for the project">
<mkdir dir="${dist.dir}"/>
<jar destfile="${dist.dir}/myproject.jar">
<fileset dir="${build.dir}"/>
</jar>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment