ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject RE: Observations from an ANT newbie
Date Wed, 20 Jun 2001 16:17:10 GMT
You didn't need to do all that -- all you needed to do was copy&paste the
example into a build.xml file, and have at least one .java file, either in
the same directory or in some subdir from there.  Then just run 'ant'.

The reason it said there was no such target as "build" is because there
isn't one -- "build" is the name of the directory the classfile(s) will be
compiled into.

I guess the doc should explain how to use it and what the things in it
represent.  I'll try to add something later today.

Thanks,
Diane

--- Matt Warman <mwarman@udms.com> wrote:
> I create a test folder and put the following file in it. I also created
> build, src, init, dist,compile and clean folders under test.  I didn't
> see
> any source files, so I added some to src and build. I received this
> message
> from the build:
> Target 'build' does not exist in this project.
> 
> This is the build.xml file I used.
> <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="init">
>     <!-- Create the time stamp -->
>     <tstamp/>
>     <!-- Create the build directory structure used by compile -->
>     <mkdir dir="${build}"/>
>   </target>
> 
>   <target name="compile" depends="init">
>     <!-- Compile the java code from ${src} into ${build} -->
>     <javac srcdir="${src}" destdir="${build}"/>
>   </target>
> 
>   <target name="dist" depends="compile">
>     <!-- Create the distribution directory -->
>     <mkdir dir="${dist}/lib"/>
> 
>     <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar
> file
> -->
>     <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar"
> basedir="${build}"/>
>   </target>
> 
>   <target name="clean">
>     <!-- Delete the ${build} and ${dist} directory trees -->
>     <delete dir="${build}"/>
>     <delete dir="${dist}"/>
>   </target>
> </project>
> 
> 
> -----Original Message-----
> From: Diane Holt [mailto:holtdl@yahoo.com]
> Sent: Wednesday, June 20, 2001 9:38 AM
> To: ant-user@jakarta.apache.org
> Subject: RE: Observations from an ANT newbie
> 
> 
> --- Matt Warman <mwarman@udms.com> wrote:
> > If you cut and paste using the example, it won't run.
> 
> Are you referring to the full example at the end of "Using Ant"?  If you
> are, I just tried it, and it works for me. Where doesn't it work for
> you? 
> 
> Diane
> 
> =====
> (holtdl@yahoo.com)
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
> 


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Mime
View raw message