ANT properties (II)

18 February 2008

This post is in continuation of ANT properties (I). Do read that one before going through this.

There is also another property. As this property is set by the launcher script, it can not be set inside IDEs:

ant.home- home directory of Ant

Please refer the following build.xml file. Note that the properties are declared out of the target.

<project name="MyProject" default="dist" basedir=".">
    <description>
        Simple example of build file for properties
    </description>
  <property name="src" location="src"/>
  <property name="build" location="build"/>
  <property name="dist"  location="dist"/>
 
  <target name="init">
    <tstamp/>
    <mkdir dir="${build}"/>
  </target>
 
  <target name="compile" depends="init"
        description="compile the source " >
    <javac srcdir="${src}" destdir="${build}"/>
  </target>
 
  <target name="dist" depends="compile"
        description="generate the distribution" >
    <mkdir dir="${dist}/lib"/>
 
    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
  </target>
 
  <target name="clean"
        description="clean up" >
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>

del.icio.us:ANT properties (II)  digg:ANT properties (II)  spurl:ANT properties (II)  wists:ANT properties (II)  simpy:ANT properties (II)  newsvine:ANT properties (II)  blinklist:ANT properties (II)  furl:ANT properties (II)  reddit:ANT properties (II)  fark:ANT properties (II)  blogmarks:ANT properties (II)  Y!:ANT properties (II)  smarking:ANT properties (II)  magnolia:ANT properties (II)  segnalo:ANT properties (II)  gifttagging:ANT properties (II)

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: ANT properties (II)

Leave a Reply