...
 
Commits (41)
stages:
- analyse
- doc
- test
- deploy
variables:
......@@ -27,8 +27,8 @@ regex_check:
- make regex_check
sphinx_html:
stage: doc
image: git.mel.vin:5005/template/doc/cicd/sphinx_html:1.1
stage: test
image: git.mel.vin:5005/template/doc/cicd/sphinx_html:1.2
script:
- mkdir build
- cd build
......@@ -55,7 +55,7 @@ review:
- mkdir -p ~/.ssh
- echo "$DOC_SSH_KNOWNHOSTS" > ~/.ssh/known_hosts
- eval $(ssh-agent)
- echo "$DOC_SSH_KEY" | ssh-add - >/dev/null
- echo "$DOC_SSH_KEY" | ssh-add - > /dev/null
- mv build/doc/html public
- rsync -a --delete public/ doc@mel.vin:~/template/doc/$CI_ENVIRONMENT_SLUG
......@@ -73,7 +73,7 @@ review_stop:
- mkdir -p ~/.ssh
- echo "$DOC_SSH_KNOWNHOSTS" > ~/.ssh/known_hosts
- eval $(ssh-agent)
- echo "$DOC_SSH_KEY" | ssh-add - >/dev/null
- echo "$DOC_SSH_KEY" | ssh-add - > /dev/null
- mkdir /tmp/empty
- rsync -a --delete --filter="+ $CI_ENVIRONMENT_SLUG" --filter='-,p *'
/tmp/empty/ doc@mel.vin:~/template/doc
......
......@@ -5,6 +5,10 @@ Reverse chronologically sorted, i.e. newest on top.
For details view the associated milestone of a release which are linked below.
View the commit history for minor fixes and improvements.
## 1.10.0 / 2018-09-16
https://git.mel.vin/template/c/milestones/17
## 1.9.1 / 2018-07-27
https://git.mel.vin/template/c/milestones/16
......
......@@ -23,19 +23,23 @@ endif()
unset(PROJECT_LANGUAGES)
project(doc_template
VERSION 1.9.1
VERSION 1.10.0
DESCRIPTION "__DESCRIPTION__"
LANGUAGES ${PROJECT_LANGUAGES})
set(PROJECT_VERSION_SUFFIX "") # alpha/beta/rc, e.g. "-rc0"
set(CMAKE_PROJECT_VERSION_SUFFIX "${PROJECT_VERSION_SUFFIX}")
foreach (prefix "" "CMAKE_")
set("${prefix}PROJECT_VERSION"
"${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX}")
set("${prefix}PROJECT_AUTHOR" "__AUTHOR__")
set("${prefix}PROJECT_COPYRIGHT" "__COPYRIGHT__")
set("${prefix}PROJECT_MAIL" "__AUTHOR_MAIL__")
endforeach(prefix)
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
set(PROJECT_VERSION "${PROJECT_VERSION}${PROJECT_VERSION_SUFFIX}")
set(PROJECT_AUTHOR "__AUTHOR__")
set(PROJECT_COPYRIGHT "__COPYRIGHT__")
set(PROJECT_MAIL "__AUTHOR_MAIL__")
# only set CMAKE variant when local name matches CMAKE name
# this avoids clashing when being used as a subproject
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CMAKE_PROJECT_VERSION "${PROJECT_VERSION}")
set(CMAKE_PROJECT_VERSION_SUFFIX "${PROJECT_VERSION_SUFFIX}")
set(CMAKE_PROJECT_AUTHOR "${PROJECT_AUTHOR}")
set(CMAKE_PROJECT_COPYRIGHT "${PROJECT_COPYRIGHT}")
set(CMAKE_PROJECT_MAIL "${PROJECT_MAIL}")
endif()
include(version)
if(NOT DOC STREQUAL "OFF")
......
......@@ -14,8 +14,8 @@ documentation:
The official project home and all official mirrors:
* Home: https://git.mel.vin/template/doc
* GitLab: https://gitlab.com/melvinvermeeren/template\_doc
* GitHub: https://github.com/melvinvermeeren/template\_doc
* GitLab: https://gitlab.com/melvinvermeeren/template_doc
* GitHub: https://github.com/melvinvermeeren/template_doc
## Build
......@@ -25,8 +25,6 @@ The official project home and all official mirrors:
## Documentation
* a nice directory layout that is easily extended
* [Doxygen](https://www.stack.nl/~dimitri/doxygen/)
* for technical API documentation in source code
* [Sphinx](http://www.sphinx-doc.org/en/stable/)
* for all other documentation in wonderful reStructuredText
......
git.mel.vin:5005/template/doc/cicd/sphinx_html:1.1
git.mel.vin:5005/template/doc/cicd/sphinx_html:1.2
#!/bin/sh
PLANTUML=1.2018.8
PLANTUML=1.2018.10
set -e
apk --no-cache add \
cmake \
doxygen \
font-noto \
git \
graphviz \
......
Subproject commit 383262f4896d258a555886be07f5790d5d092d03
Subproject commit 39e2048c1a5f5ac3ef33f56266cb9a44b242646e
add_custom_target(line_limit
COMMENT "Running line_limit checks"
COMMAND WERROR=${WERROR} ./cmake/line_limit.sh
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")
......@@ -11,6 +11,7 @@ SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
# call line_limit.sh to check repo
"$SCRIPT_DIR/../cicd/style/line_limit.sh" \
-e '^build[^/]*/' \
-e '^.*\.svg$' \
-i "$SCRIPT_DIR/.."
exit 0
add_custom_target(regex_check
COMMENT "Running regex_check checks"
COMMAND WERROR=${WERROR} ./cmake/regex_check.sh
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}")
......@@ -11,6 +11,7 @@ SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
# call regex_check.sh to check repo
"$SCRIPT_DIR/../cicd/style/regex_check.sh" \
-e '^build[^/]*/' \
-e '^.*\.svg$' \
"$SCRIPT_DIR/.."
"$SCRIPT_DIR/../cicd/style/regex_check.sh" \
-e '^build[^/]*/' \
......
if(NOT IS_DIRECTORY "${CMAKE_SOURCE_DIR}/.git")
if(NOT IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git")
return()
endif()
......@@ -12,7 +12,7 @@ find_package(Git REQUIRED)
# 1.3.2-1-g846ffe7, one commit since tag
# 1.3.2-1-g846ffe7+, one commit since tag, dirty
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --dirty=+ --tags --always
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
OUTPUT_VARIABLE TMP_VER
OUTPUT_STRIP_TRAILING_WHITESPACE)
......@@ -36,14 +36,20 @@ endif()
string(REGEX REPLACE "^(.*)-[0-9]+-g([0-9a-f]+\\+?)$" "\\1-\\2"
TMP_VER "${TMP_VER}")
# only override CMAKE_ variant when they currently match
# subprojects do not use CMAKE_ variant
if(PROJECT_VERSION STREQUAL CMAKE_PROJECT_VERSION)
set(CMAKE_PROJECT_VERSION "${TMP_VER}")
endif()
# only set CMAKE variant when local name matches CMAKE name
# this avoids clashing when being used as a subproject
set(PROJECT_VERSION "${TMP_VER}")
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(CMAKE_PROJECT_VERSION "${PROJECT_VERSION}")
endif()
message(STATUS "Updated version to ${PROJECT_VERSION}.")
# do not message if actual version did not change
if(NOT PROJECT_VERSION STREQUAL PROJECT_VERSION_PREV)
set(PROJECT_VERSION_PREV "${PROJECT_VERSION}" CACHE STRING
"Project version during previous cache build." FORCE)
mark_as_advanced(PROJECT_VERSION_PREV)
message(STATUS "Updated version to ${PROJECT_VERSION}.")
endif()
unset(TMP_VER)
unset(TMP_TAG)
......
set(DOC_SRC "${CMAKE_SOURCE_DIR}/doc")
set(DOC_DEST "${CMAKE_BINARY_DIR}/doc/${DOC}")
set(DOC_TMP "${CMAKE_BINARY_DIR}/tmp/doc")
set(DOC_SRC "${PROJECT_SOURCE_DIR}/doc")
set(DOC_DEST "${PROJECT_BINARY_DIR}/doc/${DOC}")
set(DOC_TMP "${PROJECT_BINARY_DIR}/tmp/doc")
if(DOC STREQUAL "html")
set(EXTRA_PYTHON_MODULES "sphinx_rtd_theme")
......
......@@ -34,7 +34,7 @@
extensions = ['sphinxcontrib.plantuml']
# plantuml config
plantuml = '@PLANTUML_PATH@ -config "@CMAKE_SOURCE_DIR@/doc/plantuml.cfg"'
plantuml = '@PLANTUML_PATH@ -config "@PROJECT_SOURCE_DIR@/doc/plantuml.cfg"'
plantuml_output_format = 'svg_img'
plantuml_latex_output_format = 'pdf'
......
......@@ -117,7 +117,7 @@ print("Initializing the template.")
# basic project info
cmakelist = os.path.join(scp_dir, "CMakeLists.txt")
pname = def_input("Project name", prj_dir)
pname = def_input("Project name (no whitespace)", prj_dir)
taskq.put(ReReplaceTask(cmakelist, "(\nproject\\()doc_template(\n)",
"\\g<1>" + pname + "\\g<2>"))
......@@ -159,9 +159,15 @@ if use_ci == "yes":
taskq.put(ReReplaceTask(gitlabci, ver_cur, ver_new))
# update review/pages only for project, not forks
taskq.put(ReReplaceTask(gitlabci, "(\n +- [a-z]+@)template/doc(\n)",
"\\g<1>" + gitlab_group + '/' + pname
+ "\\g<2>"))
taskq.put(ReReplaceTask(gitlabci,
"(?m)^( +- [a-zA-Z0-9/-]+@)template/doc$",
"\\g<1>" + gitlab_group + '/' + pname))
# update direct references to doc_template such as for appimages
# XXX keep this one last to edit gitlabci as it is not context-aware
taskq.put(ReReplaceTask(gitlabci,
"([^a-zA-Z0-9])doc_template([^a-zA-Z0-9])",
"\\g<1>" + pname + "\\g<2>"))
# update image registry location
for root, dirs, files in os.walk(dockertarget):
......@@ -174,7 +180,7 @@ if use_ci == "yes":
else:
taskq.put(DeleteTask(gitlabci))
# delete c template descriptive files
# delete doc template descriptive files
taskq.put(DeleteTask(os.path.join(scp_dir, 'README.md')))
taskq.put(DeleteTask(os.path.join(scp_dir, 'CHANGELOG.md')))
taskq.put(DeleteTask(os.path.join(scp_dir, 'LICENCE')))
......