I'm working on setting up an Ant file to grab the commit revision from Bitbucket and outputting that value into a name.properties file where I have a code.version=12345 line of code. I want to update that value with the current revision number. This is what I have right now:
<property name="site" value="${dir}" />
<property name="site.properties" value="../${site}/site.properties" />
<target name="get-core-version">
<exec executable="git" outputproperty="git.version">
<arg value="log" />
<arg value="--pretty=format:%h" />
<arg value="-1" />
</exec>
<propertyfile file="${site.properties}" comment="Core code revision number">
<entry key="core.version" value="${git.version}" />
</propertyfile>
</target>
Right now, when I run the above, it returns a 0. But, if I run it through command line, all is well and returns what I expect from it.
The result I'm getting from the above code inside the properties file is:
#Core code revision number
#Fri, 02 Oct 2015 16:10:40 -0400
core.version=b3cd3d7