Set custom build number in TeamCity
<p>I have version=x.y.z property in gradle.properties in my git repo. The custom build number needs to be version-build.counter 
We used the following custom script in TeamCity(running on Windows) to read this file and set the build number. Would like to know if anyone is aware of a better way to do this. </p>

<pre><code>echo extracting version from gradle.properties
for /f %%%%i in ('type gradle.properties ^| find "version"') do set VERSION_PROPERTY=%%%%i
echo %%VERSION_PROPERTY%%
for /f "tokens=2 delims==" %%%%G IN ("%%VERSION_PROPERTY%%") DO SET VERSION=%%%%G
echo version = %%VERSION%%
echo "##teamcity[buildNumber '%%VERSION%%.%build.counter%']"
</code></pre>