ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dale G. Herrig" <dale_her...@agilent.com>
Subject Re: classes not going where expected
Date Tue, 27 Feb 2001 14:51:56 GMT
Cathal Mc Ginley wrote:

> Hi,
> If I get you correctly, you have a directory structure with all your
> java files and classes in, say, /home/dale/com/foobar and I'm going to
> guess your build.xml is also in /home/dale/com/foobar with ${basedir}
> set to ".", and javac srcdir and destdir also set to "."
>
> Right, if this is the case then all you need to do is move your project
> basedir as follows:
> <project basedir="/home/dale" ....
> then set the javac sredir and destdir to ${basedir}
> The javac task will search recursively through the directories below the
> srcdir to find java files, and when it does it'll compile them into a
> directory structure reflecting the package structure, below the destdir.
>
> Get it? Well, if not try the following build.xml, and see if it turns
> out like you expected. Substitute /home/dale for the directory just
> above your com/foobar directories
>
> <project name="foobar" basedir="/home/dale" default="compile">
>
>    <target name="compile">
>       <javac srcdir="${basedir}" destdir="${basedir}" />
>    </target>
>
> </project>
>
> It might also help if you kept your build.xml in your equivalent of
> /home/dale to keep a nice neat structure.
>
> Hope this helps...

Thanks,  Cathal,  this is exactly the
answer I was looking for.

>
>
>  - C.
>
> "Dale G. Herrig" wrote:
> >
> > I have a package,  com.foobar.AntTest
> > when I compile the java files in the
> > directory of the same  name, I would
> > expect the class files to appear there,
> > since I have my 'srcdir="."' and
> > "destdir="."' as shown in the below
> > compile target,
> > but instead a sub-directory is created
> >
> > com/foobar/AntTest
> >
> > and the class files stored there.
> >
> >    <!--#######[ compile target ]#######-->
> >    <target name="compile" depends="prepare">
> >        <javac srcdir  = "."
> >               destdir = "."
> >       />
> >    </target>
> >
> > How can I get the class file to be compiled in
> > the directory I am in, which is  classpath
> > directory with it creating a sub-directory.

Mime
View raw message