ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Walend <dwal...@eecs.tufts.edu>
Subject Re: Example on web page
Date Thu, 27 Jul 2000 04:02:48 GMT
Thanks again for the comments. Another revision:

<project name="MyProject" default="dist" basedir=".">

  <!-- set global properties for this build -->
  <property name="src" value="." />
  <property name="build" value="build" />
  <property name="dist"  value="dist" />

  <target name="prepare">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}" />
  </target>

  <target name="compile" depends="prepare">
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}" />
  </target>

  <target name="dist" depends="compile">
    <!-- Create the ${dist}/lib directory 
       put everything in ${build} into the MyProject-${DSTAMP}.jar file-->
    <mkdir dir="${dist}/lib" />
    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" 
           basedir="${build}" />
  </target>

  <target name="clean">
    <!-- Delete the ${build} and ${dist} directory trees -->
    <deltree dir="${build}" />
    <deltree dir="${dist}" />
  </target>
</project>

------------------------------
Changes this time:

Hey Barrie... It's still grey! 

Changed the name of the project from "foo" to "MyProject." Is there a way
to get the project name as a property? 

Removed init target and put tstamp into prepare.

Removed the comment in the file about filtering

Removed the <include> tags (after downloading last night's build).

Decided not to add a javadoc target. I want to keep this really simple.
Barrie, perhaps one of us should update the javadoc example after this
one.

Decided to leave ${src} as "." I'm in the "build.xml is part of the source
code" school. And I want kids at home to be able to toss this file into a 
directory with some java source and get a .jar file.

Dave


Mime
View raw message