Cool Ant file trick and concept
Published on
I watched Qasim Rasheed's CFUnited presentation on Continuous Integration with SVN, ANT, CFUnit & Selenium. I picked up a fundamental concept, Conditional Execution, and a cool trick. The concept was the if and unless attribute of an ant target. I have read about them but it was great to see them in action. He covered it quick so I had to watch that section a couple times.
Basically:
<target name="if" if="propertyName" ...> I run if propertyName is define
<target name="unless" unless="propertyName" ...> I run if propertyName is NOT defined so
The trick was in an Ant File (using the Ant Editor - thanks Jim) pressing Ctrl and mouse over properties (example ${property}) , the ${property} will turn blue and underlined. If you click the ${property}, the editor will jump to where the property is defined in the file. If the property was set in a property file, the editor will jump to where the property file is defined in the ant file. If you hold Ctrl and click on the property file, the editor will open up the file. Pretty sweet. I wonder how Ant files are doing this since it would be interesting to have this feature in CFEclipse for some variables. I guess this Ctrl-Click feature is - Go to declaration of object at cursor.