Is there a way to check if two values equal each other regardless of case? For instance "myValue" equals "myvalue" case-insensative.
<if>
<equals arg1="myValue" arg2="myvalue" />
<then>
...
</then>
</if>
ant-contrib sucks. It usually results in spaghetti code that is really really hard to read - and requires people to add the ant-contrib jars.
You're usually better off letting ant be ant... It isn't a scripting language, but a simple declaration of build steps. If you want to get fancy, you'd do this by writing your own task in java where you'd have an IDE, debugger and unit tests.
In ant you'd do this with the <condition>
task, specifically <equals>
with casesensitive="false"
to set a property and then conditionally run a target based on that property. For example, run this guy with ant -Darg1="foo" -Darg2="foo"
<?xml version="1.0" encoding="utf-8"?>
<project name="condition" default="condition-true" basedir=".">
<condition property="strings-match">
<equals arg1="${arg1}" arg2="${arg2}" casesensitive="false"/>
</condition>
<target name="display-props">
<echo>"arg1 = ${arg1}"</echo>
<echo>"arg2 = ${arg2}"</echo>
<echo>"strings-match = ${strings-match}"</echo>
</target>
<target name="condition-true" depends="display-props" if="${strings-match}">
<echo>true</echo>
</target>
</project>
I know this doesn't answer your question, which is specifically about ant-contrib. I'll even further go astray by saying I'd never make a new ant file (prefering gradle or maven) Interesting reading: