3 # Author: Mike Beattie <mike@ethernal.org>
5 # Script to parse result from git describe, and push values into
6 # BuildInfo.java for use within altosdroid (to display the current
7 # version and build information, primarily).
10 infile=src/org/altusmetrum/AltosDroid/BuildInfo.java.in
11 outfile=src/org/altusmetrum/AltosDroid/BuildInfo.java
18 builddate=$(date "+%Y-%m-%d")
19 buildtime=$(date "+%H:%M")
23 describe=$(git describe --match "$version" --long --always 2>/dev/null || echo '')
24 if [ -n "$describe" ]; then
25 branch=$(git branch | sed -ne 's/^\* //p')
26 commitdetails=$(echo $describe | sed -e "s/^$version-//")
27 commitnum=$(echo $commitdetails | cut -s -d- -f1)
28 commithash=$(echo $commitdetails | cut -d- -f2)
32 echo "Version $describe, built on $builddate $buildtime $buildtz"
34 sed -e "s/@VERSION@/$version/" \
35 -e "s/@DESCRIBE@/$describe/" \
36 -e "s/@BRANCH@/$branch/" \
37 -e "s/@COMMITNUM@/$commitnum/" \
38 -e "s/@COMMITHASH@/$commithash/" \
39 -e "s/@BUILDDATE@/$builddate/" \
40 -e "s/@BUILDTIME@/$buildtime/" \
41 -e "s/@BUILDTZ@/$buildtz/" \