You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by James Todd <jw...@pacbell.net> on 2000/06/27 18:30:16 UTC

Re: cvscommit:jakarta-ant/src/main/org/apache/tools/ant/taskdefsJavac.java

thx for the pointer. i'll update and check out the new features.
i'm reluctant to break up the package tree just because i build
different flavours from time to time ... and i do hate having the
resource files hanging off on the side.

i'll give it a whirl,

- james

Conor MacNeill wrote:

> James,
>
> > hey conor -
> >
> >     i'm curious as to if this resolves or worsens a problem i've
> >     had with ant, that being that if i do a "build of a sub-branch"
> >     of a package tree any/all resource files (eg xml, properties)
> >     get reparented under the root package name.
> >
>
> All this patch does is to give a warning that copying of support files is
> deprecated and fix up some strange indenting.
>
> >     but, when i do a "branch build" using a tag as follows:
> >
> >         <javac srcdir="foo/bar/bop" ...
> >
>
> OK, the issue here is that javac (the compiler) relies on the package
> statement in your java source code to determine where to place the generated
> classes in the destination build area. javac (the task) uses the relative
> directory position to determine the location of support files. When you
> point srcdir into the middle of your source tree, the effect is to reparent
> the support files higher up in the destination hierarchy.
>
> I think it is best if your srcdir attribute always points to the root of
> your package hierarchy. To achieve your branch build, you should use
> appropriate <include> constructs in your javac task
>
>         <javac srcdir="dir above foo">
>           <include name="foo/bar/bop/**/*.java"/>
>         </javac>
>
> You may need to get an up to date version of ant for this capability - not
> sure.
>
> Conor