Skip to content

Commit

Permalink
Merge pull request #1335 from rolanddenis/fix_doc
Browse files Browse the repository at this point in the history
Fixing documentation checks and updating Travis build
  • Loading branch information
dcoeurjo committed Jul 29, 2018
2 parents 8f3ca8c + 9e17147 commit f879fc4
Show file tree
Hide file tree
Showing 31 changed files with 270 additions and 136 deletions.
39 changes: 22 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,40 +69,45 @@ addons:
- g++-5

before_install:
- export DEC="false";
- source .travis/before_global.sh
- echo "C++ ===> $CXXCOMPILER"
- if [ $CONFIG == "Debug,Cairo,QGLviewer,HDF5,EIGEN" ]; then source .travis/install_eigen.sh ; cd $TRAVIS_BUILD_DIR; fi
- if [ $CONFIG == "Debug,Cairo,QGLviewer,HDF5,EIGEN" ]; then source "$SRC_DIR/.travis/install_eigen.sh" ; fi
- echo $EIGEN_ROOT
- if [ $CONFIG == "Documentation" ]; then export NEEDEXAMPLESANDTESTS="false"; export NEEDCORE="false"; export BUILD_DOC="true"; if [ $OriginalRepo == "true" ]; then if [ $TRAVIS_PULL_REQUEST == "false" ]; then export UPLOAD_DOC="true"; fi; fi; fi
- if [ $CONFIG == "Debug,Magick,GMP,ITK,FFTW3" ]; then export BTYPE="-DCMAKE_BUILD_TYPE=Debug -DWITH_MAGICK=true -DWITH_GMP=true -DWITH_FFTW3=true -DBUILD_TESTING=ON -DWARNING_AS_ERROR=ON"; fi
- if [ $CONFIG == "Debug,Cairo,QGLviewer,HDF5,EIGEN" ]; then export DEC="true"; export BTYPE="-DCMAKE_BUILD_TYPE=Debug -DWITH_HDF5=true -DWITH_CAIRO=true -DWITH_QGLVIEWER=true -DBUILD_TESTING=ON -DWITH_EIGEN=true -DWARNING_AS_ERROR=OFF -DEIGEN3_INCLUDE_DIR='$EIGEN_ROOT/include/eigen3'"; fi
- if [ $CONFIG == "DGtalTools" ]; then export NEEDEXAMPLESANDTESTS="false"; export BTYPE="-DCMAKE_BUILD_TYPE=Debug -DWITH_MAGICK=true -DWITH_GMP=true -DWITH_HDF5=true -DWITH_CAIRO=true -DWITH_QGLVIEWER=true -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=off"; fi
- if [ $UPLOAD_DOC == "true" ]; then openssl aes-256-cbc -K $encrypted_47769ec71275_key -iv $encrypted_47769ec71275_iv -in .travis/dgtal_rsa.enc -out .travis/dgtal_rsa -d; chmod 600 .travis/dgtal_rsa; BUILD_DOC="true"; fi
- if [ $BUILD_DOC == "true" ]; then wget --no-check-certificate http://dgtal.org/doc/tags/DGtalTools-tagfile; fi
- if [ $BUILD_DOC == "true" ]; then .travis/install_doxygen.sh; export BTYPE="-DDOXYGEN_EXECUTABLE=$HOME/doxygen/doxygen-1.8.10/bin/doxygen"; fi
- if [ $CONFIG == "Documentation" ]; then export BUILD_DOC="true"; if [ $OriginalRepo == "true" ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then export UPLOAD_DOC="true"; fi; fi
- if [ $CONFIG == "Debug,Magick,GMP,ITK,FFTW3" ]; then export BUILD_ALL="true"; export BTYPE="$BTYPE -DCMAKE_BUILD_TYPE=Debug -DWITH_MAGICK=true -DWITH_GMP=true -DWITH_FFTW3=true -DWARNING_AS_ERROR=ON"; fi
- if [ $CONFIG == "Debug,Cairo,QGLviewer,HDF5,EIGEN" ]; then export BUILD_ALL="true"; export BUILD_DEC="true"; export BTYPE="$BTYPE -DCMAKE_BUILD_TYPE=Debug -DWITH_HDF5=true -DWITH_CAIRO=true -DWITH_QGLVIEWER=true -DWITH_EIGEN=true -DWARNING_AS_ERROR=OFF -DEIGEN3_INCLUDE_DIR='$EIGEN_ROOT/include/eigen3'"; fi
- if [ $CONFIG == "DGtalTools" ]; then export BUILD_DGTAL="true"; export BTYPE="$BTYPE -DCMAKE_BUILD_TYPE=Debug -DWITH_MAGICK=true -DWITH_GMP=true -DWITH_HDF5=true -DWITH_CAIRO=true -DWITH_QGLVIEWER=true"; fi
- if [ $UPLOAD_DOC == "true" ]; then openssl aes-256-cbc -K $encrypted_47769ec71275_key -iv $encrypted_47769ec71275_iv -in "$SRC_DIR/.travis/dgtal_rsa.enc" -out "$SRC_DIR/.travis/dgtal_rsa" -d; chmod 600 "$SRC_DIR/.travis/dgtal_rsa"; fi
- if [ $BUILD_DOC == "true" ]; then wget --no-check-certificate -O "$BUILD_DIR/DGtalTools-tagfile" http://dgtal.org/doc/tags/DGtalTools-tagfile; fi
- if [ $BUILD_DOC == "true" ]; then "$SRC_DIR/.travis/install_doxygen.sh"; export BTYPE="-DDOXYGEN_EXECUTABLE=$HOME/doxygen/doxygen-1.8.10/bin/doxygen"; fi


########
# Deps.
########
before_script:
- if [ $TRAVIS_OS_NAME == linux ]; then echo "All done."; fi
- if [ $TRAVIS_OS_NAME == osx ]; then source .travis/install_deps_macos.sh; fi

- if [ $TRAVIS_OS_NAME == linux ]; then echo "All done."; fi
- if [ $TRAVIS_OS_NAME == osx ]; then source "$SRC_DIR/.travis/install_deps_macos.sh"; fi
- source "$SRC_DIR/.travis/fix_step_dependencies.sh"

############
# Main rules
############
script:
- echo "---- $BTYPE ---$BUILD_DOC---$UPLOAD_DOC"
- .travis/main_build.sh
- if [ $CONFIG == "DGtalTools" ]; then .travis/getAndCheckDGtalTools.sh ; fi
- if [ $CONFIG == "Documentation" ]; then .travis/checkDoxygenDocumentation.sh; fi
- "$SRC_DIR/.travis/configure_build.sh"
- if [ $BUILD_DGTAL == "true" ]; then "$SRC_DIR/.travis/build_dgtal.sh"; fi
- if [ $BUILD_DEC == "true" ]; then "$SRC_DIR/.travis/build_dec.sh"; fi
- if [ $BUILD_EXAMPLES == "true" ]; then "$SRC_DIR/.travis/build_examples.sh"; fi
- if [ $BUILD_TESTS == "true" ]; then "$SRC_DIR/.travis/build_tests.sh"; fi
- if [ $BUILD_TESTS == "true" ]; then "$SRC_DIR/.travis/check_tests.sh"; fi
- if [ $BUILD_DGTAL == "true" ]; then "$SRC_DIR/.travis/build_all.sh"; fi
- if [ $CONFIG == "DGtalTools" ]; then "$SRC_DIR/.travis/getAndCheckDGtalTools.sh" ; fi
- if [ $BUILD_DOC == "true" ]; then "$SRC_DIR/.travis/build_doc.sh"; fi
- if [ $BUILD_DOC == "true" ]; then "$SRC_DIR/.travis/checkDoxygenDocumentation.sh"; fi


###########
## Building the documentation
###########
after_success:
- if [ $UPLOAD_DOC == "true" ]; then echo "Uploading the doc..."; .travis/publish_doc.sh; fi
- if [ $UPLOAD_DOC == "true" ]; then echo "Uploading the doc..."; "$SRC_DIR/.travis/publish_doc.sh"; fi
52 changes: 43 additions & 9 deletions .travis/before_global.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,54 @@
#!/bin/bash

# Useful paths
export SRC_DIR="$TRAVIS_BUILD_DIR"
export BUILD_DIR="$SRC_DIR/build"

# Options send to the set command.
# e to exit immediately if a command fails
# v to print each input lines as they are read (useful for debugging)
export SET_OPTIONS=e

# Commands at script begin and end
export SCRIPT_BEGIN="set -$SET_OPTIONS"
export SCRIPT_END="set +$SET_OPTIONS ; cd \"$SRC_DIR\""

# Debug
echo $SCRIPT_BEGIN
echo $SCRIPT_END

$SCRIPT_BEGIN

# Main steps configuration
export BUILD_DOC="false"
export UPLOAD_DOC="false"
export NEEDCORE="true"
export BUILD_DGTAL="false"
export BUILD_EXAMPLES="false"
export BUILD_TESTS="false"
export BUILD_DEC="false"
export BUILD_ALL="false" # Build DGtal, examples and tests

export NEEDEXAMPLESANDTESTS="true";
export SRC_DIR="`pwd`"
# Build default options
export BTYPE=
export BJOBS=2 # See https://docs.travis-ci.com/user/reference/overview/#Virtualisation-Environment-vs-Operating-System

export CCOMPILER = $CC
export CXXCOMPILER = $CXX
if [ $CC == "gcc" ]; then export CCOMPILER=gcc-5 ; export CXXCOMPILER=g++-5; fi
# Compiler configuration
export CCOMPILER=$CC
export CXXCOMPILER=$CXX
if [ "$CC" == "gcc" ]
then
export CCOMPILER=gcc-5
export CXXCOMPILER=g++-5
fi

# Build directory
mkdir -p "$BUILD_DIR"

export MAGICK_CONFIG_PATH=".travis/delegate.mgk"
$MAGICK_CODER_MODULE_PATH
$MAGICK_FILTER_MODULE_PATH
##Preparing folders
mkdir deps/
mkdir deps/local

# Preparing folders
mkdir -p "$SRC_DIR/deps/local"

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal build
cd "$BUILD_DIR"
make -j $BJOBS

$SCRIPT_END
14 changes: 14 additions & 0 deletions .travis/build_dec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
$SCRIPT_BEGIN

### Dec
echo "Compile Dec in non parallel mode to save memory (to fix gcc internal compiler error(Killed))";

cd "$BUILD_DIR"
make exampleDiscreteExteriorCalculusChladni
#make exampleDiscreteExteriorCalculusSolve
#make exampleDECSurface
make examplePropagation
make testDiscreteExteriorCalculusExtended

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_dgtal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal build
cd "$BUILD_DIR"
make -j $BJOBS DGtal

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal Doc
cd "$BUILD_DIR"
make doc > buildDoc.log

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal Examples
cd "$BUILD_DIR/examples"
make -j $BJOBS

$SCRIPT_END
8 changes: 8 additions & 0 deletions .travis/build_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal Tests
cd "$BUILD_DIR/tests"
make -j $BJOBS

$SCRIPT_END
40 changes: 25 additions & 15 deletions .travis/checkDoxygenDocumentation.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
#!/bin/bash
$SCRIPT_BEGIN

return_code=0
return_code2=0
return_code3=0
HOMEPATH=$PWD

DOXYGENLOG=${BUILD_DIR}/doxygen.log

## We first check that the doxygen.log is empty
if [[ -s doxygen.log ]]
if [[ -f "$DOXYGENLOG" ]]
then
return_code=1
echo "Doxygen log file not empty !"
echo "====================================="
cat doxygen.log
echo "====================================="
if [[ -s "$DOXYGENLOG" ]]
then
return_code=1
echo "Doxygen log file not empty !"
echo "====================================="
cat "$DOXYGENLOG"
echo "====================================="
else
echo "Doxygen log OK"
return_code=0
fi
else
return_code=0
return_code=1
echo "Doxygen log file not found !"
fi


## We check src code consitency
cd src/
$HOMEPATH/.travis/check_src_file_tag.sh
if [[ $? -ne 0 ]]
cd "$SRC_DIR/src"
"$SRC_DIR/.travis/check_src_file_tag.sh"
if [[ $? == 0 ]]
then
return_code2=1;
echo "@file tag OK"
else
return_code=1;
fi
cd ..

Expand All @@ -32,5 +41,6 @@ cd ..
# TODO
#

return_code=$((return_code + return_code2 + return_code3))
$SCRIPT_END

exit $return_code
3 changes: 3 additions & 0 deletions .travis/check_examples_file_tag.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
$SCRIPT_BEGIN

return_code=0

Expand All @@ -17,4 +18,6 @@ do
fi
done

$SCRIPT_END

exit $return_code
5 changes: 4 additions & 1 deletion .travis/check_src_file_tag.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
$SCRIPT_BEGIN

return_code=0

# Checking that source code has proper @file tag
for file in `find * -type f \( -name \*.cpp -o -name \*.h -o -name \*.ih \)`
for file in $(find * -type f \( -name \*.cpp -o -name \*.h -o -name \*.ih \))
do
expected_name=$(basename $file)
if ! $(grep -aqE "^\s*(\**|//[/!]|/\*[\*!])\s*?[@\\\\]file(\s+${expected_name})?\s*$" $file)
Expand All @@ -18,4 +19,6 @@ do
fi
done

$SCRIPT_END

exit $return_code
17 changes: 17 additions & 0 deletions .travis/check_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
$SCRIPT_BEGIN

### DGtal Tests
cd "$BUILD_DIR/tests"

if [ -f io/writers/testMagickWriter ]; then
io/writers/testMagickWriter -s
fi

if [ -f io/readers/testMagickReader ]; then
io/readers/testMagickReader
fi

ctest -j $BJOBS --output-on-failure

$SCRIPT_END
15 changes: 15 additions & 0 deletions .travis/configure_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
$SCRIPT_BEGIN

# Build directory
cd "$BUILD_DIR"

# Common build options
export BTYPE="$BTYPE -DBUILD_TESTING=$BUILD_TESTS -DBUILD_EXAMPLES=$BUILD_EXAMPLES -DCMAKE_CXX_COMPILER=$CXXCOMPILER -DCMAKE_C_COMPILER=$CCOMPILER"

# Cmake
echo "Using C++ = $CXXCOMPILER"
echo "CMake options = $BTYPE"
cmake "$SRC_DIR" $BTYPE

$SCRIPT_END
27 changes: 27 additions & 0 deletions .travis/fix_step_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
$SCRIPT_BEGIN

if [[ "$BUILD_DEC" == "true" ]]
then
export BUILD_TESTS="true"
export BUILD_EXAMPLES="true"
fi

if [[ "$BUILD_ALL" == "true" ]]
then
export BUILD_TESTS="true"
export BUILD_EXAMPLES="true"
export BUILD_DGTAL="true"
fi

if [[ "$BUILD_TESTS" == "true" ]] || [[ "$BUILD_EXAMPLES" == "true" ]]
then
export BUILD_DGTAL="true"
fi

if [[ "$UPLOAD_DOC" == "true" ]]
then
export BUILD_DOC="true"
fi

$SCRIPT_END
11 changes: 8 additions & 3 deletions .travis/getAndCheckDGtalTools.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/bash
$SCRIPT_BEGIN

## Get and test if DGtalTools compiles
DGTALPATH=`pwd`
DGTALPATH="$SRC_DIR"
echo "DGtal path = $DGTALPATH"
git clone --depth 1 git://github.com/DGtal-team/DGtalTools.git
cd DGtalTools
mkdir build ; cd build
cmake .. -DDGtal_DIR=$DGTALPATH/build $BUILD
make -j 2
cmake .. -DDGtal_DIR="$BUILD_DIR" $BUILD
make -j $BJOBS

$SCRIPT_END
5 changes: 5 additions & 0 deletions .travis/install_deps_macos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash
$SCRIPT_BEGIN

set +e # The brew install has errors

#
# Note: gmp and boost already installed
Expand All @@ -12,3 +15,5 @@ brew install http://liris.cnrs.fr/david.coeurjolly/misc/libqglviewer.rb
## Temporary HDF5 build issue
export BTYPE="$BTYPE -DWITH_HDF5=false" && echo "Disabling HDF5 on MacOS";
export BTYPE="$BTYPE -DWITH_QT5=true -DCMAKE_PREFIX_PATH=$(brew --prefix qt5)" && echo "Forcing Qt5 on MacOS";

$SCRIPT_END
3 changes: 3 additions & 0 deletions .travis/install_doxygen.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
$SCRIPT_BEGIN

#
##Download and install 1.8.1
#

mkdir ~/doxygen && cd ~/doxygen
wget http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.10.linux.bin.tar.gz && tar xzf doxygen-1.8.10.linux.bin.tar.gz

$SCRIPT_END
Loading

0 comments on commit f879fc4

Please sign in to comment.