1212 directories :
1313 - ${HOME}/deps/cmake
1414 - ${HOME}/deps/protobuf
15+ # - ${HOME}/deps/proto2cpp
1516
1617# Handle dependencies in separate directory.
1718before_install :
@@ -21,6 +22,7 @@ before_install:
2122 - mkdir -p "${DEPS_DIR}"
2223 - cd "${DEPS_DIR}"
2324
25+ # Install necessary packages.
2426install :
2527 # Install a recent version of CMake
2628 - |
@@ -33,12 +35,34 @@ install:
3335 PROTOBUF_URL="https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz"
3436 if [ ! -f ${DEPS_DIR}/protobuf/install/bin/protoc ] ; then mkdir -p protobuf ; travis_retry wget --no-check-certificate --quiet -O - ${PROTOBUF_URL} | tar --strip-components=1 -xz -C protobuf ; cd protobuf ; ./configure --prefix=${DEPS_DIR}/protobuf/install ; make ; make install ; fi
3537 export PATH=${DEPS_DIR}/protobuf/install/bin:${PATH}
38+
39+ # Install proto2cpp for doxygen
40+ - |
41+ PROTO2CPP_URL="https://github.com/OpenSimulationInterface/proto2cpp.git"
42+ if [ ! -f ${DEPS_DIR}/proto2cpp ] ; then mkdir -p proto2cpp ; git clone ${PROTO2CPP_URL} ${DEPS_DIR}/proto2cpp ; fi
43+
44+ # Environment variables.
45+ env :
46+ global :
47+ - GH_REPO_ORG=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 1`
48+ - GH_REPO_NAME=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 2`
49+ - GH_REPO_REF="github.com/$GH_REPO_ORG/$GH_REPO_NAME.git"
50+
51+ # Addons necessary for documentation.
52+ addons :
53+ apt :
54+ packages :
55+ - doxygen
56+ - doxygen-doc
57+ - doxygen-latex
58+ - doxygen-gui
59+ - graphviz
3660
3761# Change directory back to default build directory.
3862before_script :
3963 - cd "${TRAVIS_BUILD_DIR}"
4064
41- # Run the build script.
65+ # Run the build script and generate documentation .
4266script :
4367 - mkdir -p build
4468 - cd build
@@ -50,3 +74,20 @@ script:
5074 - python setup.py sdist
5175 - cd build
5276 - cmake --build . --target install
77+ - cd ..
78+ - echo "" >> VERSION
79+ - echo "VERSION_PATCH = \"GitHub_MasterBranch\"" >> VERSION
80+ - cd build
81+ - cmake -D FILTER_PROTO2CPP_PY_PATH=${DEPS_DIR}/proto2cpp ..
82+ - doxygen
83+ - cd ..
84+
85+ # Deploy the documentation on github (only for master branch).
86+ deploy :
87+ provider : pages
88+ skip_cleanup : true
89+ local_dir : doc/html
90+ keep-history : true
91+ github_token : ${GH_REPO_TOKEN}
92+ on :
93+ branch : master
0 commit comments