ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: probably the last one on Java Dependencies.
Date Fri, 15 Jun 2001 18:09:06 GMT
Your "srcdir" should point up to the directory just before your package
hierarchy begins. Your "destdir" can point to wherever you want the output
files to go, but you don't need to include the package-hierarchy structure
in it. For example, if your work area is laid out like:

                    foo     bar     blat
                     |       |       |

then your "srcdir" attribute should point to /viraj/work/src. Let's say
you want the classfiles to go under /viraj/work/build/classes, then your
"destdir" would point there, and when you run your compiles, assuming has a "package;" statement, has a "package;", and has a "package com.blat;", the classfiles
will go into:

You need to <mkdir> the /viraj/work/build/classes directory, but the
compilation process itself will create the package-structure
subdirectories and put the classfiles into that structure. If the .java
files were in a package-like directory structure, but didn't include the
corresponding package statements, then the classfiles would go into the
"destdir" itself, not into package-structure subdirs, and <javac> wouldn't
be able to find them -- unless you specified the "srcdir" attribute to be
the full-path to the directory the source-files lived in.


--- Viraj Purang <> wrote:
> Hi Diane,
> 	There is probably one last bit to the priblem that I was talking
> about for dependencies, I did see that if put my dest dir with the 
> package
> structure like 
> <javac   srcdir="." destdir="${cpath}/com/spincircuit/utils"
> depend="off"
> verbose="on"
> vlet.jar}......"
>              deprecation="off" debug="on" optimize="off" target="1.2"
> in the first iteration it picks up the class files from the right
> location
> and gives me info like the following : 
>     [javac] omitted as
> s is up 
>     [javac] omitted as
> C:\CVS1\builder\client\build\classes\com\spincircuit\utils\Mail.class is
> up
> to date.
>     [javac] added as
> ss is outdated.
>     [javac] Compiling 1 source file to
> C:\CVS1\builder\client\build\classes\com\spincircuit\utils
>     [javac] Using classic compiler
> which is what I want finally.
> But now because of the packaging statement inside the java file the
> output
> goes into ...
> ${cpath}/com/spincircuit/utils/com/spincircuit/util...
> I know of no option in Java that turns this packaging attachment to
> "off".
>    This leaves me 1 option (albeit a dirty one) ... to maually copy the
> directory 
>      ${cpath}/com/spincircuit/utils/com/spincircuit/utils... into
> ${cpath}/com/spincircuit/utils, unless youknow of a better solution ...
> The issue would not exist if I did not have a packaging structure ...but
> that is highly unlikely.
> Regards,
> Viraj Purang


Do You Yahoo!?
Spot the hottest trends in music, movies, and more.

View raw message