4 # This bash script generates CMSIS-FreeRTOS documentation
7 # - bash shell (for Windows: install git for Windows)
9 # - linkchecker (can be skipped with -s)
13 # Set version of gen pack library
14 # For available versions see https://github.com/Open-CMSIS-Pack/gen-pack/tags.
15 # Use the tag name without the prefix "v", e.g., 0.7.0
16 REQUIRED_GEN_PACK_LIB="0.11.0"
18 DIRNAME=$(dirname "$(readlink -f "$0")")
20 REQ_DXY_VERSION="1.13.2"
26 echo "Usage: $(basename "$0") [-h] [-s] [-c <comp>]"
27 echo " -h,--help Show usage"
28 echo " -s,--no-linkcheck Skip linkcheck"
29 echo " -c,--component <comp> Select component <comp> to generate documentation for. "
30 echo " Can be given multiple times. Defaults to all components."
33 while [[ $# -gt 0 ]]; do
39 '-s'|'--no-linkcheck')
47 echo "Invalid command line argument: $1" >&2
55 ############ DO NOT EDIT BELOW ###########
57 # Set GEN_PACK_LIB_PATH to use a specific gen-pack library root
58 # ... instead of bootstrap based on REQUIRED_GEN_PACK_LIB
59 if [[ -f "${GEN_PACK_LIB_PATH}/gen-pack" ]]; then
60 . "${GEN_PACK_LIB_PATH}/gen-pack"
62 . <(curl -sL "https://raw.githubusercontent.com/Open-CMSIS-Pack/gen-pack/main/bootstrap")
66 find_doxygen "${REQ_DXY_VERSION}"
67 [[ ${RUN_LINKCHECKER} != 0 ]] && find_linkchecker
69 if [ -z "${VERSION_FULL}" ]; then
70 VERSION_FULL=$(git_describe "v")
73 pushd "${DIRNAME}" > /dev/null
75 echo_log "Generating documentation ..."
77 projectName=$(grep -E "PROJECT_NAME\s+=" freertos.dxy.in | sed -r -e 's/^PROJECT_NAME\s*=\s*"?([^"]*)"?/\1/')
78 projectNumberFull="${VERSION_FULL}"
79 projectNumber="${projectNumberFull%+*}"
80 datetime=$(date -u +'%a %b %e %Y %H:%M:%S')
83 sed -e "s/{projectNumber}/${projectNumber}/" freertos.dxy.in > freertos.dxy
85 git_changelog -f html -p "v" > src/history.txt
87 echo_log "\"${UTILITY_DOXYGEN}\" freertos.dxy"
88 "${UTILITY_DOXYGEN}" freertos.dxy
90 mkdir -p "${DIRNAME}/${GENDIR}/search/"
91 cp -f "${DIRNAME}/style_template/search.css" "${DIRNAME}/${GENDIR}/search/"
92 cp -f "${DIRNAME}/style_template/search.js" "${DIRNAME}/${GENDIR}/search/"
93 cp -f "${DIRNAME}/style_template/navtree.js" "${DIRNAME}/${GENDIR}"
94 cp -f "${DIRNAME}/style_template/resize.js" "${DIRNAME}/${GENDIR}"
96 sed -e "s/{datetime}/${datetime}/" "${DIRNAME}/style_template/footer.js.in" \
97 | sed -e "s/{year}/${year}/" \
98 | sed -e "s/{projectName}/${projectName}/" \
99 | sed -e "s/{projectNumber}/${projectNumber}/" \
100 | sed -e "s/{projectNumberFull}/${projectNumberFull}/" \
101 > "${DIRNAME}/${GENDIR}/footer.js"
103 popd > /dev/null || exit 1
105 [[ ${RUN_LINKCHECKER} != 0 ]] && check_links "${DIRNAME}/${GENDIR}/index.html" "${DIRNAME}"