It seems that the TeamCity parameter ${build.counter} is not resolving in our ant build.xml. We have:
<replaceregexp
file="AndroidManifest.xml"
match='android:versionCode="(.*)"'
replace='android:versionCode="${build.counter}"'
/>
This throws the error:
String types not allowed (at 'versionCode' with value '${build.counter}')
It looks like it is taking the parameter "${build.counter}" as a literal string.
Using another TeamCity integer parameter in place of ${build.counter}, for example ${teamcity.build.id}, works fine.
Does anyone know why this might be?
Update
Thanks Biswajit_86 for the answer. Here also is my related discussion with JetBrains:
<echo>${build.counter}</echo>
right before this step. One random nitpick: your regex replacement doesn't use capture group references, so your match pattern doesn't need parentheses. – CAustinbuild.counter=Step 2/2] echo ${build.counter}
or something similar to that. – CAustin