ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Couple of mods to <javac>
Date Mon, 11 Sep 2000 06:19:13 GMT
I've made a couple of modifications to <javac> for my own needs, but I
thought they might be of use to other users as well.

One problem I was having with <javac> is that I have source files that
live in subdirs, but that need to be built into the top level of the build
tree. The problem was they were always getting rebuilt, since <javac>
makes the class filename match the path of the source filename, and looks
for destdir/srcpath/to/file.class rather than just destdir/file.class --
which is perfectly fine in most cases, just not in all.

So, I pilfered the "flatten" stuff from <copydir> and added it to <javac>.
Now you can have a flatten attribute for <javac>, which when true, will
have it look for the classfile in the destdir you've specified, not in the
destdir modified with the source file's path.

The thing is, I don't know Java any better than I do sanskrit (ie., not at
all :), so I have no idea if the way I did it is actually correct. It
works, but it does seem like I had to do some odd contortions (for one
thing, I cannot get an "else" to work for me in Java -- I have no idea
why). I'm willing to put the change out here, if people are interested in
it -- but only if you promise not to point and laugh.

The second modification I made is along the lines of the one Conor made,
in that it lists the files it's dealing with, but this one lists all the
files it's checking, not just the ones it's going to compile (it just
lists them, it doesn't say anything about their state). I need this,
because I'm dealing with a source tree I can't just say **/*.java with
(there are .java files in it that don't get compiled, and that aren't
going away any time soon). So I want to (not often, but sometimes) see all
the files it's actually picking up so I can compare it against the files I
know it should only be... wildcards make me a little jumpy :)  This one is
turned on with a "listfiles" attribute.  Same qualifiers and offer as

The third thing I tried for, but failed to accomplish in any clean way,
was to have some kind of visual output on really long scans. I can get it
to put a trailing "." across the screen as it goes thru the directories,
which is fine (at least there's enuf going on to not make you think it's
wedged :) -- I just couldn't get it to do it in any kind of reasonable
conditional way, so I had to scrap it for now. If anyone has any ideas on
how I could make it happen tho, I'd be grateful (watching a screen doing
nothing for 7 minutes can be very disheartening... still, it's better than
the 11 I used to have to watch it for :)

(P.S. I also cleaned up all the comments wrt copying files, since as I
understand it that behaviour is gone now.)



Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!

View raw message