Ant tidbits

August 30th, 2002 by Hen

So here I am reading the Ant book on Safari. Bound to be lots of new things as although I’ve used Ant a lot, and have happily written Tasks, there are large areas I’ve never gone near.

First tidbit: ant -projecthelp lists the targets and subtargets. Doh. Last time I make a target called “targets” which echoes out the top level targets :) ant -help being what I should have typed all this time.
Second tidbit: Ant reads build files in the following: First it scans all children of the <project> tag. It finds errors in their attributes or tag names. Then it goes into each child, depth first. So errors are found in the first <target> and its dependencies before the second <target>, unless the second <target> is a dependency.

Third tidbit: Environment variables. Ant really needs to see these and I’ve never found out how to do it. Well the book tells me: <property environment=”env”/> then any variable starting with ‘env.’ is taken from the system environment. For example, <property name=”xalan.home” value=”${env.XALAN_HOME}”/>. Happiness.

Fourth tidbit: Regexps. Ant has a pluggable regexp system, so it can handle both types of Jakarta regexp library as well as Suns. Always a nice touch. Now to somehow get it out of Ant and into Jakarta Commons so all can use the concept.

I’ll end it there. Halfway through the book and I’m feeling happy with Safari already.

Comments are closed.