Thursday, October 08, 2015

Get Substring from nAnt property

In order to get sub-string of the nAnt property, to be used in xmlpoke for nAnt I used following statement. Besides the sub-string the following statement also returns the upper case of the string. Here GIT.Commit is the nAnt property.

<xmlpoke file="my.config" xpath="//UI//application//@version" value="${Version}.${string::substring(string::to-upper(GIT.Commit),0,5)}" />