Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / July 2003

Tip: Looking for answers? Try searching our database.

how does ANT work?

Thread view: 
Roedy Green - 11 Jul 2003 05:26 GMT
Does ANT work by parsing any changed file to discover the
dependencies?  

Can it be relied on to recompile everything that needs it if a static
final changes?  Is there any case where it fails to recompile when it
should?

Is ANT smart enough to avoid loading the compiler over and over for
each file; i.e.  does it invoke it only once for the whole shot?

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Stefan Bodewig - 11 Jul 2003 08:37 GMT
> Does ANT work by parsing any changed file to discover the
> dependencies?  

Depends on the task you are talking about.  For most tasks, including
<javac> it does not.  <javac> simply compares the timestamps of *.java
and *.class and compiles those files with outdated .class files.

<depend> in turn parses the compiled .class files to discover
dependencies, then compares the timestamps of .class files to the
.java files and deletes all .class files that are older then the .java
files of any class they depend upon.  <javac>'s timestamp checking
after that is going to succeed then.

There are third party tasks like <javamake> - see Ant's external tools
page - that can do that in one step and are more sophisticated.

> Can it be relied on to recompile everything that needs it if a
> static final changes?

No.

And a static final primitive will be inlined by the compiler so even
<depend> will not detect the change (as it wouldn't detect the
dependency) - not sure whether <javamake> would.

> Is ANT smart enough to avoid loading the compiler over and over for
> each file; i.e.  does it invoke it only once for the whole shot?

It will invoke the compiler exactly once per <javac> task (that
actually needs to compile at least one file).

Stefan


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.