//do something ..." />

Reuse and execution control in Ant?

Maybe you can put your ant code to give a better answer. But one way to do that is to use the depends attribute target name="prepare"> //do something to prepare //do something to cleanup //build production //build debug //do something or nothing.

Maybe you can put your ant code to give a better answer. But one way to do that is to use the depends attribute //do something to prepare //do something to cleanup //build production //build debug //do something or nothing With this you are telling to ant that before execute the "build-production-debug" target you want to first run all the targets listed on "depends" attribute an do it on that order.

Thanks for you answer, sorry I didn't give enough info to help you help me. Depends here isn't sufficient since I needed something more like "prepare -> build-production -> cleanup" and then "prepare -> build-debug -> cleanup". – Stephen Swensen Apr 20 at 15:31.

Here's the outline of what I came up with, I am still using antcalls but only as an entry point in order to parameterize my builds. The key discovery for me was using the if condition on a target, to control whether the target gets executed, noting that the targets in its depends chain still execute. The condition and isset tasks also helped out in certain places.

In other words, antcall sidesteps the normal dependency rules that are the cornerstone of Ant. I don't think antcall should be used as a substitute for normal Ant-like dependencies; that's what depends is for. So when would you use it?

The antcall task does allow you to control what properties and references are defined (which is why a new Ant environment is created--and why it's so slow) so it can be used to create variants of the same thing; e.g. , maybe two jars, one with and one without debug symbols. Overusing antcall, however, creates slow, brittle, and hard to maintain build scripts. Think of it as the goto of Ant--it's evil.

Most well-written build scripts simply don't need it except in unusual cases.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions