I am looking for some util methods for strings manipulation. Eg. split a version into its major.minor.bugfix parts:
1.0.2
major=1
minor=0
bugfix=2
I have looked at:
http://www.docjar.com/docs/api/org/apache/tools/ant/util/StringUtils.html
which is located in my C:\apache-ant-1.8.2\lib\ant.jar
but how do I use eg. the plit method in my build.xml file?
Here its done using groovy:
http://www.coderanch.com/t/431213/tools/Ant-Split-string-assign-property
But is there no “official” ant jar/extensions that contain this basic kind of string manipulation tasks that can be called in my build.xml file?
See Ant Addon Flaka, it provides some functions for string manipulation,
some examples here.
The answer to your problem is the example :
Question : Given is an ant property which has value of the type 1.0.0.123
How to extract the value after the last dot, in this case that would be ‘123’ ?
Solution : use the split function with index
Alternatively use Groovy’s Ant task or script task with groovy/jruby/beanshell..