package.sh 786 B

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