From c8b276a1fbf2669c1d77620c9d6aff0331ebed75 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 22 Dec 2017 22:12:27 +0000 Subject: Including doxygen in cmake --- scripts/update_docs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/update_docs b/scripts/update_docs index cf117f73..be1eaf1d 100755 --- a/scripts/update_docs +++ b/scripts/update_docs @@ -1,14 +1,13 @@ #!/usr/bin/env bash if [[ "$TRAVIS_BRANCH" == "master" ]]; then - doxygen ./docs/Doxyfile - if [ -d "$TRAVIS_BUILD_DIR/html" ]; then + if [ -d "$TRAVIS_BUILD_DIR/build/doc_doxygen/html" ]; then git clone -b gh-pages "https://$GH_TOKEN@github.com/ymherklotz/YAGE.git" YAGE_gh-pages cd YAGE_gh-pages git config user.name "TravisBot" git config user.email "" rm -rf * - cp -r ../html/* . + cp -r ../build/doc_doxygen/html/* . git add -A . git commit -m "Rebuilding documentation" git push -q origin gh-pages -- cgit From 204997112044a0920f3b379321c31274f5c73cb7 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 22 Dec 2017 22:22:34 +0000 Subject: Improving travis configuration --- scripts/travis_build | 33 +++++++++++++++++++++++++++++++++ scripts/update_docs | 16 ---------------- scripts/update_version | 38 -------------------------------------- 3 files changed, 33 insertions(+), 54 deletions(-) create mode 100755 scripts/travis_build delete mode 100755 scripts/update_docs delete mode 100755 scripts/update_version (limited to 'scripts') diff --git a/scripts/travis_build b/scripts/travis_build new file mode 100755 index 00000000..3cca70a2 --- /dev/null +++ b/scripts/travis_build @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# check compiler versions +$CC --version +$CXX --version + +# go to correct directory +cd $TRAVIS_BUILD_DIR + +# start building +mkdir -p build +cd build +cmake .. +make +cd tests +ctest +cd ../.. + +# update docs if we are on the master branch +if [[ "$TRAVIS_BRANCH" == "master" ]]; then + if [ -d "$TRAVIS_BUILD_DIR/build/doc_doxygen/html" ]; then + git clone -b gh-pages "https://$GH_TOKEN@github.com/ymherklotz/YAGE.git" YAGE_gh-pages + cd YAGE_gh-pages + git config user.name "TravisBot" + git config user.email "" + rm -rf * + cp -r ../build/doc_doxygen/html/* . + git add -A . + git commit -m "Rebuilding documentation" + git push -q origin gh-pages + cd .. + fi +fi diff --git a/scripts/update_docs b/scripts/update_docs deleted file mode 100755 index be1eaf1d..00000000 --- a/scripts/update_docs +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -if [[ "$TRAVIS_BRANCH" == "master" ]]; then - if [ -d "$TRAVIS_BUILD_DIR/build/doc_doxygen/html" ]; then - git clone -b gh-pages "https://$GH_TOKEN@github.com/ymherklotz/YAGE.git" YAGE_gh-pages - cd YAGE_gh-pages - git config user.name "TravisBot" - git config user.email "" - rm -rf * - cp -r ../build/doc_doxygen/html/* . - git add -A . - git commit -m "Rebuilding documentation" - git push -q origin gh-pages - cd .. - fi -fi diff --git a/scripts/update_version b/scripts/update_version deleted file mode 100755 index 9c618fa6..00000000 --- a/scripts/update_version +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# ----------------------------------------------------------------------------- -# @file: add_version_headers -# -# Copyright (c) 2017 Yann Herklotz Grave -# MIT License, see LICENSE file for more details. -# ----------------------------------------------------------------------------- - - -import os -import re -import sys - - -def main(argv): - cwd = os.path.join(os.getcwd(), argv[2]) - cmake = os.path.join(cwd, "CMakeLists.txt") - doxyfile = os.path.join(cwd, "docs", "Doxyfile") - - with open(cmake, "r+") as f_: - src = f_.read() - f_.seek(0) - src = re.sub(r"(project\(\w+\s+VERSION\s+)[0-9.]+", r"\g<1>{0}.0".format(argv[1]), src, re.MULTILINE) - f_.write(src) - f_.truncate() - - with open(doxyfile, "r+") as f_: - src = f_.read() - f_.seek(0) - src = re.sub(r"(PROJECT_NUMBER\s+=\s+v)[0-9.]+", r"\g<1>{0}".format(argv[1]), src, re.MULTILINE) - f_.write(src) - f_.truncate() - - return 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv)) -- cgit From 0f9d8a7f951a58252175c0b3280f24ef6529150f Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 22 Dec 2017 22:36:04 +0000 Subject: [Travis] Improving build file and docs generation --- scripts/travis_build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/travis_build b/scripts/travis_build index 3cca70a2..40c774eb 100755 --- a/scripts/travis_build +++ b/scripts/travis_build @@ -17,8 +17,8 @@ ctest cd ../.. # update docs if we are on the master branch -if [[ "$TRAVIS_BRANCH" == "master" ]]; then - if [ -d "$TRAVIS_BUILD_DIR/build/doc_doxygen/html" ]; then +if [[ $TRAVIS_BRANCH = "master" && $BUILD_DOCS -eq 1 ]]; then + if [[ -d "$TRAVIS_BUILD_DIR/build/doc_doxygen/html" ]]; then git clone -b gh-pages "https://$GH_TOKEN@github.com/ymherklotz/YAGE.git" YAGE_gh-pages cd YAGE_gh-pages git config user.name "TravisBot" @@ -26,7 +26,7 @@ if [[ "$TRAVIS_BRANCH" == "master" ]]; then rm -rf * cp -r ../build/doc_doxygen/html/* . git add -A . - git commit -m "Rebuilding documentation" + git commit -m "[Travis] Rebuilding documentation" git push -q origin gh-pages cd .. fi -- cgit