In Ant, how can I test if a property ends with a given value?
For example
<property name="destdir"
value="D:\FeiLong Soft\Essential\Development\repository\org\springframework\spring-beans" />
how can I test if ${destdir} ends with "spring-beans"?
additional:
In my ant-contrib-1.0b3.jar, without ‘endswith’ task~~
As Matteo, Ant-Contrib contains a lot of nice stuff, and I use it heavily.
However, in this case can simply use the
<basename>task:The property
${ends.with.spring-beans}will containtrueif${destdir}ends withstring-beansandfalseotherwise. You could use it in theiforunlessparameter of the<target>task.