I have a build with multiple interlinked dependencies, Several projects have common dependencies that are currently compiled more than once. I think in Ant we can tell it not to re-build something if its already just done it as part of the same task, can anyone please advise
A:
Like leonm says, the compiler will do the right thing. But that won't stop Ant from rebuilding loads of artifacts. What I'd suggest is:
- where you can, make targets have a defined output. So a target that builds a jar file from sources can be skipped if those sources haven't been updated since the jar file was built.
- how do you implement this? use the uptodate task to set a property if something is actually up to date.
- I'd suggest that any targets that do checks be prefixed with a hyphen so they can't be run on their own
And finally, use the 'unless' attribute of the target element to prevent the target running.
Julian Simpson
2010-09-16 12:03:37