ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Javac
Date Fri, 20 Oct 2000 19:10:25 GMT
I also have build-order issues (it makes me feel a whole lot better to
finally find someone else who does :)  I have separate <javac> tasks, and
in the order the compiles should happen. One thing you have that's not
right is specifying the full package-path in "srcdir" -- <javac> doesn't
like that. You need to specify "srcdir" as the path leading up to where
the COM/pkg/etc. starts, then include the COM/pkg/etc. as part of the
filenames of the files you want this <javac> task to compile:

  srcdir="${srcDir}
...
  <include name="com/hcl/dal/Whatever.java"/>
etc.

But note -- there's no way I know of to prevent side-effect compiles (eg.,
I have a <javac> task that lists 2 source-files, but it ends up with 750
classfiles having been compiled, since Java compilers go build what they
need when they need it).

Diane

--- Dan MacKay <dan.mackay@KINGSTON.HUMMINGBIRD.COM> wrote:
> Hi all,
> 
> Is it possible to have javac not compile a whole tree. I have to control
> the
> the order of compilation. My directory structure is as follows:
> 
> root directory:
>                file1.java
>                file2.java
> 
>                sub_dir1:
>                         many files *.java
> 
>                sub_dir2:
>                         many files *.java
> 
>                sub_dir3:
>                         many files *.java
> 
> I have to compile and stage these files at different points through the
> build process. I have to start at the root and compile the two files
> there
> to the exclusion of the rest of the files in the resident
> sub-directories.
> My initial niave attempt was as follows:
> 
>   <target name="compile"  depends="getSource" >
>   <!-- Build the root -->
>     <echo message="Building the root"/>
>     <javac optimize="${optimize}"
>            srcdir="${srcDir}\com\hcl\dal\"
>            destdir="${outDir}"
>            classpath="${cdkDir}\lib/nova.jar;${outDir}"
>            debug="${debug}"/>
>   <!target>
> 
> This blithly motors along and compiles the whole shebang,
> sub-directories
> included and eventually fails in the sub_dir1 build when it cannot find
> dependancies for resources have not been found because they have not
> been
> staged yet. Could someone give me an example of the includes/exclude
> directives that would be necessary to ensure that only file1.java and
> file2.java are compiled?
> 
> Thanks
> 
> Dan
> 


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



__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

Mime
View raw message