xref: /btstack/tool/package.sh (revision 1cc8850a162636b6ffb5115e87a73202bd68f362)
1#!/usr/bin/env sh
2
3# get absolute path
4TOOL_DIR=`dirname "$0"`
5BTSTACK_ROOT=`realpath ${TOOL_DIR}/..`
6
7# get tag from git
8tag=`git tag --points-at HEAD`
9
10# get git version
11commit=`git rev-parse --short HEAD`
12
13# use tag if available
14if [ -z "$tag" ]
15then
16    version=${commit}
17else
18    version=${tag}-${commit}
19fi
20
21# zip repository
22archive_zip="btstack-${version}.zip"
23echo Create ${archive_zip}
24cd ${BTSTACK_ROOT} && git archive --format=zip -o ${archive_zip} HEAD .
25
26# build HTML documentation
27echo Build HTML documentation
28cd ${BTSTACK_ROOT}/doc/manual && make update_content html 2&> /dev/null
29
30# add HTML documentation to zip archive
31echo Add HTML documentation to zip archive as doc/manual/btstack
32cd ${BTSTACK_ROOT} && zip ${archive_zip} doc/manual/btstack > /dev/null
33
34echo Done
35