Peter Donald wrote:
At 02:21 21/11/00 -0500, you wrote:Here's a suggestion for a new feature in Ant. I would like to see the
capability for a "default" or dynamic target in Ant. What this would do is
catch all target invocations (or target invocations based on a pattern)This has been suggested a number of times before ;) However I don't like it
and I think the general consensus is that it is too complex. If you are
going to do that you may end up doing regular _expression_ matches in
depends/target matching. This increases the complexity too much for little
gain. "The road to make is paved with good intentions" ;)
Instead you can "preprocess" ant files (via xslt/css/other) to do all the
morphing of build till it matches ant specs. Hopefully the next version of
ant will allow you to run special preprocessors that allow you to do all
sorts of things
Actually, I have been preprocessing my Ant files - I even use a tiny make file to preprocess and kick off Ant. ;-) And since I finally learned how to merge XML files using XSLT (document() is a great thing...), I'm even more dangerous. This works great, except that make doesn't support dynamic targets either (though I can get there by playing games with Gnu make....isn't this why Ant was started in the first place?) :-)
This suggestion comes from a desire to try to do things in "pure ant" as most of the project leads seem to prefer. I can certainly get by without it.
BTW, I agree that pattern targets would likely be complicated. Just for kicks, though, I prototyped the "catch all" or "default" target this afternoon. (No pattern matching is involved - it simply catches all unmatched target invocations.) With just a handful of lines added to Project, ProjectHelper, and Target, it works like a charm. I'd be happy to send the patch if anyone wants to review it.
roger
