> > 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 dep. 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 javac.java, 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. http://im.yahoo.com
