And, at the other extreme, if you do 'ant -verbose compile'
(or whatever your target is that compiles) you'll see
a list of those files that Ant determines it should compile.

If you use the optional depend task, with -verbose, it
will list all the class files it deleted, and why. Then,
since the class files that depend on a changed java
source are now missing, as Nico explained, ant will
also compile these sources corresponding to the missing
class files.

Maybe the best thing to tell the group is WHAT you want
to do, rather than asking about logging or output, etc.
That is, ask WHAT and the group can suggest HOW. Your
current question seems so wrapped up in HOW that we don't
know WHAT you want to do... (horse before the cart, so
to speak)...

Nico Seessle wrote:
> 
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 9:10 PM
> Subject: Re: Adding output
> 
> > Thanks for the input Nico, but I think I might need to
> > clarify a little bit. I am looking for the files ant is
> > going to build. It has to know this. If it didn't know
> > which files it was going to build, how would it work? It
> > seems to me that ant is doing something completely
> > different from what I am trying to do, so it looks like
> > I'll have to parse the files manually, and run through
> > all of the files I find that match the build file.
> >
> 
> I'm not sure I understood it now. Do you want to know what files running ant
> on your buildfile will create before you do it, or do you want to know what
> files got created by the last build?
> 
> For the last one see the reply from Nese Myles.
> 
> If you want to know it before running the build I will try to explain why
> ant does not (and does not need to) know exactly what you want to know.
> 
> You compile sources with ant if you use a javac-task inside your buildfile.
> With this task you specifiy a source-directory and a destination-directory.
> Ant now scans the source and destination and calls the java-compiler with
> all the sources which are newer than a class in the destination or where the
> classfile is missing. It will not look at inner classes, it will not look at
> non-public classes which may occur together with a public class inside one
> file and it will have no influence on the compiler while it is running. If
> the compiler decides it needs to compile some more classes than it get
> passed it will do so (dependency-flags may result in such things).
> 
> To make things more complicated you may have a buildfile that looks like
> (not buildfile-syntax)
> 
> target1:
>   compile from src1 to classes1
>   set property "foo" to true if there is a file
> classes1/com/company/Foo.class
> 
> main (depends target1, only run if "foo" is defined):
>   compile from src2 to classes2
> 
> Dependencies are run before the if/unless arguments are checked for.
> 
> So what do you expect ant to do if you run "ant -listclasses main" (execute
> target "main", but don't do anything, just list classes)? Ant would need to
> emulate a compiler (or four compilers since they may behave differently) to
> decide if the Foo.class would be generated (get's more complicated if it's a
> non-public class, since it may not have it's own source-file). This needs to
> be done to decide if main would really be run afterwards and if the classes
> from the javac in main would be generated or not.
> 
> Sorry if I have explained something (if this explained something) you didn't
> want to know :-)
> 
> Nico
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to