Time left in Bush's term

Days

Hours

Min.

Sec.
Countdown clock provided by BushsLastDay.com

Project Insomnia

Project Insomnia is many things, but in this context it is simply a "braindump" of whatever I happen to be thinking/reading/watching/doing at the moment. Parental guidance suggested.

Friday, September 19, 2008

Lesson Learned

So in Ant, properties set when calling a subtarget from the "depends" clause of a target are accessible to the parent target, but properties set when calling a target with "antcall" are not. Gotcha. That means I had to change this:

<target name="myTarget" depends="setPaths">
<!-- target stuff, with paths set based on a version -->
</target>

<target name="setPaths">
<!-- get a variable needed to set paths, name it "version" -->
<antcall target="setPathsFor${version}">
</antcall></target>

<target name="setPathsFor123">
<!-- set paths for version 123 -->
</target>

<target name="setPathsFor456">
<!-- set paths for version 456 -->
</target>


to this:

<target name="myTarget" depends="getVersion,setPathsFor123,setPathsFor456">
<!-- target stuff, with paths set based on a version -->
</target>

<target name="getVersion">
<!-- get the version into a property named "Version" -->
<property name="ver${Version}" value="true">
</property></target>

<target name="setPathsFor123" if="ver123">
<!-- set paths for version 123 -->
</target>

<target name="setPathsFor456" if="ver456">
<!-- set paths for version 456 -->
</target>


The upshot of which is that my "depends" line gets unmanageably long as I add supported versions, and I call each and every one of the setPathsFor targets. Is there a better way to do this?
|| Andrew, 5:47 PM || ||

"Project Insomnia" and "project-insomnia.com" ™ & SM; site contents © Andrew Rich except where noted.