|
Re: File Dependencies with Ant
|
Posted: Apr 8, 2002 11:48 AM
|
|
> Hi Bill, > > I suppose you have read this ? > http://jakarta.apache.org/ant/manual/index.html > More spcifically this one : > http://jakarta.apache.org/ant/manual/CoreTasks/depends > t.html > Yes, I've gone through the entire manual and coded up a DependSet task to delete Page.java (included in my original post). The trouble with DependSet is it just deletes the files. I'm still left with no way to conditionally run JAXB to generate them.
This document is good:
http://jakarta.apache.org/ant/ant_in_anger.html
It mentions that:
Some of the features of make, specifically inference rules and dependency checking are not included in ant. That's because they are 'different' ways of doing a build. Make requires you to state dependencies and the build steps, ant wants you to state tasks and the order between them, the tasks themselves can do depedency checking or not. A full java build using Jikes is so fast that dependency checking is relatively moot, while many of the other tasks (but not all), compare the timestamp of the source file with that of the destination file before acting.
> Even on big project I usually delete all the targets > & keep the dependency list very small ! > Yeah, but my particular situation is that the jar file being built by this one line in my makefile is used to generate every page on this website (including the one you're looking at). So whenever that jar file changes, I have to rebuild my entire website. It is not workable to just say I'll rebuild the entire website every time I do anything, because there are over 12,000 pages.
The Ant in Anger doc makes it clear that it is up to the tasks to do their own dependency checking, and my problem is that JAXB doesn't do any dependency checking. So what I think I need is a task like DependSet that, instead of deleting the target files if any are older than any source files, it runs a different task to regenerate the target files. I'm surprised no one has run across this before, but I don't see such a task anywhere. I may end up taking DependSet and hacking it until it does the thing I need. If anyone knows of such a task already in existence, please post its whereabouts here.
Thanks.
|
|