You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ed Greenberg <ed...@greenberg.org> on 2003/08/05 22:36:09 UTC

newbie question re srcdir and destdir (edg)

I'm trying to understand my first ant scripts.

I have
<project basedir="." default="all" name="myapp">
	...
    <target depends="init" name="compile">
         <javac debug="true" deprecation="true" destdir="./WEB-INF/classes" 
srcdir="./src"/>
    </target>
	...
</project>

My build.xml sits in the same directory as src/ and WEB-INF/.

I have one source file located in
	./src/foo/loo/moo/test.java
When I execute this script, I get a directory tree created as
	

I would have expected the compiler to create
	./WEB-INF/classes/foo/loo/moo/test.class
given the statement in the ant manual that:

  <javac srcdir="${src}"
         destdir="${build}"
         classpath="xyz.jar"
         debug="on"
  />
compiles all .java files under the ${src} directory,
                         ^^^^^
and stores the .class files in the ${build} directory.

Can somebody tell me what I'm doing wrong?

Thanks,
</edg>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: newbie question re srcdir and destdir (edg)

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 05 Aug 2003, Ed Greenberg <ed...@greenberg.org> wrote:

> I would have expected the compiler to create
> 	./WEB-INF/classes/foo/loo/moo/test.class

If and only if the class test lives in the package foo.loo.moo.

javac will create your directory hierarchy according to your package
hierarchy and distribute the class files accordingly.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org