If you want to test a property from a custom task in Apache Ant 1.8, you can use the testUnlessCondition
and testIfCondition
in org.apache.tools.ant.PropertyHelper
:
@Override public void execute() throws BuildException { final PropertyHelper propertyHelper = PropertyHelper.getPropertyHelper(getProject()); if(propertyHelper.testUnlessCondition(requiredPropertyName)) { // property is missing } } |