开发者

ant build issues

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 p开发者_JS百科lease advise


ant's javac task will only compile if the source files are newer than the target files. So that should save you some time.

You can also look into ivy for a bit more formal dependency management.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜