ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject RE: Dependencies
Date Tue, 12 Dec 2000 23:53:36 GMT
My understanding is: jikes will (optionally) recompile classes that a
changed source-file *depends on* (either "blindly" [-depend] or as-needed
[+F]), but it won't recompile all the source-files that *depend on* a
source-file that has changed.

But while we're on the topic of your <depend> task... I've downloaded the
CVS directory -- do I need to do anything special to compile it? Also, I
didn't see any documentation for it -- is there any? Can it be in its own
target? I'd like to make running it optional, which would mean it having
its own target, so I can if/unless on that. Does it require that all the
classfiles have been built prior to running it?


--- Conor MacNeill <> wrote:
> Dave,
> > Two questions:
> >
> >      1) Does ANT and/or jdk1.3-based JAVAC perform automatic "forward"
> > dependency-checking?  That is, ClassA depends on
> >           ClassB depends on ClassC, and a change is made to
> >, will
> > ANT or JAVAC figure that out and include it upon
> >           recompiling  I think JAVAC does this
> > automagically under
> > jdk1.3, replacing the need for the unofficial
> >           -Xdepend option of jdk1.2.2, but I would like someone
> > to confirm that
> > this is correct.
> I think, in general, you want this to work the other way around. When
> you
> change you want ClassB and hence classA recompiled. When
> javac
> compiles ClassA, it will not, and should not, compile ClassB and ClassC,
> since the dependencies work the other way around. They should only be
> recompiled if they have been changed.
> In any case, I do not think javac handles such dependencies. I'd be
> happy to
> be wrong on that. I have heard that the Jikes compiler does handle such
> dependencies but I haven't checked that out. This is really what the
> <depend> task is for. It adds the dependency handling in a way which
> does
> not impact the javac task. If you change classC, the depend task will
> remove
> classB.class and, optionally, classA.class
> >
> >      2) Conor: LOVE the stuff you're doing with "reverse"
> > dependency-checking.
> > I haven't even downloaded your code yet --- and I
> >           will --- but before I start picking through it, I
> > thought I'd ask
> > whether it can be easily tweaked to spit out  logfile of all
> dependencies
> >           it has found.  That is, when I compile
> > com.mycompany.mypackage, could
> > I generate a list of all classes that depends on
> >           somewhere?  Like I said, I'll look at your code myself,
> > but I thought
> > you might be able to tell me off the top of your head.
> The depend task works out dependencies in one direction (classX depends
> on
> ClassY, ClassZ) and then reverses that to arrive at an "affects" list
> (classZ affects classX, classT). There is some code, which is commented
> out
> currently, which prints out the dependencies. You can uncomment that to
> see
> the dependencies. Be warned that the output for even moderate
> collections of
> classes can be quite large.
> Conor


Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.

View raw message