ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vitaly Stulsky" <>
Subject RE: Dependencies between Java Classes
Date Wed, 03 May 2000 14:12:43 GMT
> Hi,
> I am new to Ant. I am using it to build my Java application. Let's assume
> there are 2 classes in my application (A and B). Class A is dependent on
> Class B. So when I modify Class B and build the application Class B should
> be compiled  and Class should also be compiled as it depends on Class B. But
> ant compiles only Class B as it's source file is newer than it's class file
> and since Class A hasn't changed it is not compiled at all.

Ant *ONLY* checks dates and pass to javac modified files only. In your case
javac receives class B source only. There are exist more complex cases where
dependencies cannot be tracked at all (even by javac).

> I have 2 targets one for compiling Class B and one for compiling Class A.
> Is this the right way to do it or should I have a single target which
> compiles all the class files in the project.
I work upon smart dependency tracking for ANT now. But for now I turned off ANT
tracking and pass complete list to javac. It is a bit slower than with dep.
tracking, but
with this I'm sure that my project is rebuilt correctly.

> I couldn't find any reference to class dependencies in the ant
> documentation.
Try to look at the source code. It is easy to find. See, scanDir.

> Am I missing something.
Try to use jikes. This compiler has smart dependency tracking.

> Cheers,
> Akbar

Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.

View raw message