Ant: make "available" throw an understandable error?
- by digitala
When running ant, how do I make an <available /> block throw an adequate error message?
This is what I have so far:
<target name="requirements">
<available classname="foo.bar.baz" property="baz.present" />
</target>
<target name="directories" depends="requirements" if="baz.present">
<mkdir dir="build" />
</target>
<target name="compile" depends="directories">
<!-- build some stuff -->
</target>
What I'm currently seeing when requirements fails is a message complaining about the ./build dir not being available. How can I change this so that a message is displayed about the missing class, such as "foo.bar.baz is not available"?