ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <>
Subject Re: Multiple classes in a single file (was: Re: Can someone tell me what is so great about Ant?)
Date Wed, 07 Feb 2001 14:35:56 GMT
Conor MacNeill wrote:

> Before you guys descend into a flame war, let me make a few observations.

Please, can we.  ;^)

> If a java file produces a class file with a different name, it is very
> difficult for Ant (and I would guess make or any other build tool) to
> determine that file is missing and which java file it is required to
> compile to generate the missing file. To "know" that fact you either have
> to have remembered it from a previous compilation (presuming you can get
> the compiler to tell you or you can work it out from the class files) or
> you have to determine it by parsing the java file. You are half way to
> compilation there. It doesn't matter if the missing class file is an inner
> class.

I agree completely.  My thought was if I made them inner classes it might fix
the problem because...[see below]...

> Richard, the style you have chosen is indeed.a valid Java style. I would
> hope that javac would not produce the public class file without producing
> the non-public classes too. In other words, javac's production of class
> files should be atomic.

...javac is more likely to be atomic in the case of inner classes.  Perhaps it
wouldn't be, but that it is just an intuitive guess.

> Given however, that you are not seeing that,
> perhaps that is not true. Anyway, I do not believe Ant should be a factor
> in this compilation problem. Given all that, and the style you have chosen,
> I think you may be forced to adopt a build style of complete rebuilds.

Well, I wouldn't go that far.  First of all, I didn't actually code this
file...  :^)  Second of all, the error only happens in some instances and then
I do a "clean" and everything is okay, so I don't need to do complete rebuilds
each time...there would be practically no point to using Ant then...  :^o

I am not against restructuring the file to help it work better with Ant, but
that hardly makes it an obvious "good style" argument.

-> richard

View raw message