I'm trying to write a macro to check if a property has been set in a xml property file. If it has not been set then I want to give it a default value. This is running in a loop (using the xmltask's call) to create db property files for several different environments. The loop works great after some minor tweaking (thanks Brian!) but I've hit another stumbling block.
I've tried this several different ways and keep hitting what I think is an error between the macrodef @{property} and how the ant contrib's <if> handles the <isset> condition.
If I call it like this: <property name="temp.dbServer" value="dbServer2" /> <replaceDefaults varName="testVar" currentDefault="dbServer1" checkIsSet="${temp.dbServer}" /> It correctly enters the <then> and sets the testVar = dbServer2
If I call it like this (NOT setting the property first): <replaceDefaults varName="testVar" currentDefault="dbServer1" checkIsSet="${temp.dbServer}" /> It still enters the <then>
If I remove the line <property name="temp.checkIsSet" value="@{checkIsSet}" /> and then also change <isset property="checkIsSet" /> then it always enteres the <else>
Is there something obviously wrong that I'm doing or is this just a "limitation" of the contrib task and macrodef? Is there some more obvious way to set properties (I'm using ant contrib's <var>'s so I can do my looping) with defaults??
Any tips would be greatly appreciated! Thanks, Brent