forked from robotology/human-dynamics-estimation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored the generation of the documentation
It is now performed in an additional Travis stage and it uses a new CMake target that calls doxygen
- Loading branch information
1 parent
4f917d8
commit e39c346
Showing
9 changed files
with
3,972 additions
and
2,549 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ os: linux | |
stages: | ||
- test # Default stage with job matrix | ||
- osx | ||
- deploy | ||
|
||
env: | ||
global: | ||
|
@@ -93,6 +94,49 @@ stage_osx: | |
- cd $TRAVIS_BUILD_DIR | ||
- sh .ci/script.sh | ||
|
||
# ============= | ||
# STAGE: deploy | ||
# ============= | ||
|
||
stage_deploy: | ||
script: &deploy_script | ||
# Clone the gh-pages branch | ||
- GH_PAGES_ROOTDIR=$HOME/gh-pages | ||
- export GH_REPO_ORG=${TRAVIS_REPO_SLUG%*/*} | ||
- export GH_REPO_NAME=${TRAVIS_REPO_SLUG#*/*} | ||
- export GH_REPO_REF="github.com/$GH_REPO_ORG/$GH_REPO_NAME.git" | ||
## Select the deploy folder | ||
- DEPLOY_FOLDER=$GH_PAGES_ROOTDIR | ||
#- if [ "$TRAVIS_BRANCH" = "master" ] ; then DEPLOY_FOLDER=$GH_PAGES_ROOTDIR ; fi | ||
#- if [ "$TRAVIS_BRANCH" = "devel" ] ; then DEPLOY_FOLDER=$GH_PAGES_ROOTDIR/devel ; fi | ||
# Check if the gh-pages branch exists and clone it | ||
- cd $TRAVIS_BUILD_DIR | ||
- git ls-remote --heads --exit-code https://$GH_REPO_REF gh-pages || travis_terminate 1 | ||
- git clone -b gh-pages https://$GH_REPO_REF $GH_PAGES_ROOTDIR | ||
# Push only the current branch | ||
- cd $GH_PAGES_ROOTDIR | ||
- git config push.default simple | ||
# Clean old documentation files | ||
- rm -rf ${DEPLOY_FOLDER}/html | ||
# Disable GitHub jekyll generation | ||
- touch $GH_PAGES_ROOTDIR/.nojekyll | ||
# Generate documentation | ||
- cd $TRAVIS_BUILD_DIR | ||
- mkdir build && cd build | ||
- cmake .. -DBUILD_DOCS:BOOL=TRUE -DDOXYGEN_INSTALL_DIR=${DEPLOY_FOLDER} | ||
- make dox || travis_terminate 1 | ||
- make install | ||
# Deploy the folder | ||
- cd $GH_PAGES_ROOTDIR | ||
- git remote add origin-botlogin https://$GIT_COMMITTER_USERNAME:$DEPLOY_TOKEN@$GH_REPO_REF | ||
- git add --all | ||
- COMMIT_AUTHOR="$(git --no-pager show -s --format='%an <%ae>' $TRAVIS_COMMIT)" | ||
- >- | ||
git commit -m "Automatic docs deployment Travis#${TRAVIS_BUILD_NUMBER}" \ | ||
-m "Commit: https://github.com/$TRAVIS_REPO_SLUG/commit/$TRAVIS_COMMIT" \ | ||
--author "$COMMIT_AUTHOR" | ||
- git push --force origin-botlogin gh-pages | ||
|
||
# ====================== | ||
# BUILD JOBS FROM STAGES | ||
# ====================== | ||
|
@@ -121,6 +165,38 @@ jobs: | |
env: | ||
TRAVIS_CMAKE_GENERATOR="Unix Makefiles" | ||
TRAVIS_BUILD_TYPE="Debug" | ||
# ------------ | ||
# STAGE DEPLOY | ||
# ------------ | ||
- &deploy_template | ||
stage: deploy | ||
compiler: | ||
cache: | ||
if: fork = false AND branch = "master" AND type != pull_request | ||
before_install: skip | ||
install: skip | ||
install: skip | ||
before_script: skip | ||
script: *deploy_script | ||
after_failure: skip | ||
after_success: skip | ||
after_script: skip | ||
env: | ||
GIT_COMMITTER_USERNAME=LOC2Bot | ||
GIT_COMMITTER_NAME=LOC2Bot | ||
[email protected] | ||
DOXYGEN_INPUT_FOLDER=$TRAVIS_BUILD_DIR/build/doc/doxygen | ||
MKDOCS_INPUT_FOLDER=$TRAVIS_BUILD_DIR/build/doc/mkdocs | ||
addons: | ||
apt: | ||
packages: | ||
- doxygen | ||
- doxygen-doc | ||
- doxygen-gui | ||
- graphviz | ||
- python3-pip | ||
#- <<: *deploy_template | ||
#if: fork = false AND branch = "devel" AND type != pull_request | ||
|
||
# notifications: | ||
# email: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Provide a local project and cmake_minimum_required calls | ||
# to permit to generate the documentation without configuring | ||
# the complete project | ||
|
||
# This variable should contain the argument of the project call in the main CMakeLists.txt | ||
set(ORIGINAL_PROJECT_NAME ${PROJECT_NAME}) | ||
set(ORIGINAL_PROJECT_VERSION ${PROJECT_VERSION}) | ||
|
||
project("${ORIGINAL_PROJECT_NAME} Docs") | ||
|
||
include(GNUInstallDirs) | ||
|
||
find_package(Doxygen QUIET) | ||
|
||
if(DOXYGEN_FOUND) | ||
set(DOXYGEN_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" | ||
CACHE STRING "Build directory for Doxygen html output (absolute).") | ||
set(DOXYGEN_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${ORIGINAL_PROJECT_NAME}" | ||
CACHE STRING "Installation directory for Doxygen html output (relative to CMAKE_INSTALL_PREFIX).") | ||
|
||
# This variables are used inside the Doxyfile.in template | ||
set(DOXYGEN_PROJECT_BRIEF "Software repository for estimating human dynamics") | ||
set(DOXYGEN_SOURCE_DIR "${CMAKE_HOME_DIRECTORY}") | ||
set(DOXYGEN_DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") | ||
set(DOXYGEN_EXCLUDE_DIR "") | ||
|
||
# Generate the doxygen configuration file used by the | ||
# document generation. This step permits to use cmake variable | ||
# such as @ORIGINAL_PROJECT_NAME@ in the Doxyfile.in template | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) | ||
|
||
# Move other files required by doxygen in the build folder | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/customdoxygen.css ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/DoxygenLayout.xml ${CMAKE_CURRENT_BINARY_DIR}/ COPYONLY) | ||
|
||
# The dox target will generate the doxygen documentation in ${DOXYGEN_BUILD_DIR} | ||
add_custom_target(dox COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile | ||
COMMENT "Generating doxygen documentation in ${DOXYGEN_BUILD_DIR}") | ||
|
||
# Note: the install will install the documentation if present, | ||
# but it will not trigger a regeneration of the documentation if it is outdated | ||
install(DIRECTORY ${DOXYGEN_BUILD_DIR}/html | ||
DESTINATION ${DOXYGEN_INSTALL_DIR} | ||
OPTIONAL) | ||
|
||
endif() |
Oops, something went wrong.