Skip to content

Instantly share code, notes, and snippets.

@gpolitis
Created February 29, 2012 15:26
Show Gist options
  • Select an option

  • Save gpolitis/1941581 to your computer and use it in GitHub Desktop.

Select an option

Save gpolitis/1941581 to your computer and use it in GitHub Desktop.
Ant sample build.xml
<?xml version="1.0"?>
<project name="the project" default="compile" basedir=".">
<property name="src.dir" location="src" />
<property name="bin.dir" location="bin" />
<property name="lib.dir" location="lib" />
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${bin.dir}" />
</target>
<target name="clean" description="remove intermediate files">
<delete dir="${bin.dir}" />
</target>
<target name="compile" depends="init" description="compile the Java source code to class files">
<javac srcdir="${src.dir}" destdir="${bin.dir}" classpathref="classpath" />
</target>
</project>
@xavychan
Copy link
Copy Markdown

could you explain the need for tstamp in 'init' target?

@gpolitis
Copy link
Copy Markdown
Author

Hi @xavychan, I don't recall anymore but it looks like something that can be omitted.

@xavychan
Copy link
Copy Markdown

Okay, thanks @gpolitis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment