blob: 1dd13b6bf1a4e3d3e419c4cefe1eb2cdf0e03f77 [file] [log] [blame]
#!/bin/bash
#version rule:MAJORVERSION.MINORVERSION.REVISION-r(COMMIT_COUNT)-g(COMMIT_ID)
BASE=$(pwd)
echo $BASE
#major version
MAJORVERSION=2
#minor version
MINORVERSION=0
#reversion,now use commit count
REVISION=0
#modue name/
MODULE_NAME=MM-module-name:aml_audio_hal
#get all commit count
#fe60f72b --- audio: Mute not working on DD service [1/1]
COMMIT_COUNT=$(git log fe60f72b...HEAD --oneline | wc -l)
echo commit count $COMMIT_COUNT
#get current commit id
COMMIT_ID=$(git show -s --pretty=format:%h)
echo commit id $COMMIT_ID
#version rule string
VERSION_STRING=${MAJORVERSION}.${MINORVERSION}.${REVISION}-r${COMMIT_COUNT}-${COMMIT_ID}
#create version header file
sed "s/@version@/\"${MODULE_NAME},version:${VERSION_STRING}\"/" audio_hal/audio_hal_version.h.in > $1/audio_hal_version.h