Restrict values to ant Property task -
what simplest implementation restrict values property?
property name="prop_name" value="${dynamic_value}
i want have values ${dynamic_value}
restricted set.
thanks, wajid
you may use scriptcondition (see ant manual conditions) builtin javascript engine
(included in java >= 1.6.x), f.e. :
<project> <property name="foo" value="26"/> <fail message="value of $${foo} not in range => [${foo}] !"> <condition> <scriptcondition language="javascript"> var foo = parseint(project.getproperty("foo")); self.setvalue(foo <= 20 || foo >= 25); </scriptcondition> </fail> </project>