arduino: use git tag/revision for archive

This commit is contained in:
Matthias Ringwald 2021-05-09 22:47:16 +02:00
parent 690999b0e5
commit c7747faaec
2 changed files with 18 additions and 6 deletions

View File

@ -4,9 +4,7 @@
DIR=.
BTSTACK_ROOT=${realpath ../..}
DUMMY=$(shell )
VERSION=`sed -n -e 's/^.*BTSTACK_VERSION \"\(.*\)\"/\1/p' ${BTSTACK_ROOT}/platform/daemon/src/btstack_version.h`
BTSTACK_PACKAGE=/tmp/btstack
VERSION=$(shell ${BTSTACK_ROOT}/tool/get_git_version.sh)
ARCHIVE=$(BTSTACK_ROOT)/btstack-arduino-${VERSION}.zip
SRC_C_FILES = btstack_memory.c btstack_linked_list.c btstack_memory_pool.c btstack_run_loop.c btstack_crypto.c
@ -30,9 +28,6 @@ ARDUINO_LIBS=~/Documents/arduino/libraries/BTstack
all: release
clean:
rm -rf ${BTSTACK_PACKAGE}
update_version:
${BTSTACK_ROOT}/tool/get_version.sh

17
tool/get_git_version.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env sh
# get tag from git
tag=`git tag --points-at HEAD`
# get git version
commit=`git rev-parse --short HEAD`
# use tag if available
if [ -z "$tag" ]
then
version=${commit}
else
version=${tag}-${commit}
fi
echo "${version}"