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 Sat, 22 Jul 2000 17:23:56 GMT
On Thu, 20 Jul 2000 donaldp@mad.scientist.com wrote:

> 
> On Wed, 19 Jul 2000, David Walend wrote:
> 
> > Has anyone taken up revisting the example on the web page?
> 
> go for it :P

:-3 Yes, I'm a bucked-tooth newbie.

I've tried to (1) stay true to the existing example on the web page, (2)
get rid of all the deprecated calls in the example, (3) produce something
that anyone can drop into an existing java project and get a result, and
(4) make something that people (like me) who start with an example and
bend it to their will can use easily.

So here it is:

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

 <target name="init">
  <!-- Create the time stamp, set properties and filters -->
  <tstamp/>
  <property name="src" value="." />
  <property name="build" value="build" />
  <property name="dist"  value="dist" />
  <filter token="version" value="1.0.3" />
  <filter token="year" value="2000" />
 </target>

 <target name="prepare" depends="init">
  <!-- 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}
       Use filtering to replace @version@ and @year@ marks in the code -->
  <javac srcdir="${src}" destdir="${build}" includes="*.java"
filtering="on"/>
 </target>

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

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

</project>

I know this is an easy one, but I'd love to get some feedback before
figuring out how to submit it to the index.html page. Specifically, I'd
like to hear if you love or hate the comments, and if it works in other
places. Also, I couldn't find any guidelines on XML format for
apache/jakarta, so I winged it.

Thanks,

Dave



Mime
View raw message