From 2bcbe96fde277effce5c0ed61d7320b48e879a81 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 26 May 2016 23:51:27 +0200 Subject: [PATCH 1/1] sonarqube improvements - only trigger sonarqube on linux - regenerate a new token, and put it in the travis config on website (Otherwise the token is exposed in our git, which is not a good idea) - use the right make target - Commit the sonar config file, stupid me --- .travis.yml | 2 +- sonar-project.properties | 15 +++++++++++++++ tools/internal/travis-sonarqube.sh | 8 ++++---- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 sonar-project.properties diff --git a/.travis.yml b/.travis.yml index 5a55cd181d..ba6eb86293 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ before_install: - if [ ${TRAVIS_OS_NAME} = 'linux' ] ; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 50 ; fi script: - cmake -Denable_documentation=OFF -Denable_coverage=OFF -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=OFF -Denable_compile_optimizations=OFF -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON . && make VERBOSE=1 && ctest --output-on-failure --timeout 100 - - ./tools/internal/travis-sonarqube.sh + - if [ ${TRAVIS_OS_NAME} = 'linux' ] ; then ./tools/internal/travis-sonarqube.sh ; fi # branches: # only: # - master diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000000..1b25f0e61c --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,15 @@ +sonar.projectKey=simgrid +sonar.projectName=Scanner for the SimGrid project. http://simgrid.org +sonar.projectVersion=3.13.90 + +# Comma-separated paths to directories with sources (required) +sonar.sources=src + +# Language, needed for SonarQube < 4.2 +sonar.language=cpp + +# The build-wrapper output dir +sonar.cfamily.build-wrapper-output=bw-outputs + +# Encoding of the source files +sonar.sourceEncoding=UTF-8 diff --git a/tools/internal/travis-sonarqube.sh b/tools/internal/travis-sonarqube.sh index 8075f4a005..45c23c6dca 100755 --- a/tools/internal/travis-sonarqube.sh +++ b/tools/internal/travis-sonarqube.sh @@ -1,6 +1,6 @@ #! /bin/sh -# Run SonarQube on travis. +# Run SonarQube on travis. First version was given per email by one of the SonarQube engineer. # Install required software installSonarQubeScanner() { @@ -22,7 +22,7 @@ installBuildWrapper # triggers the compilation through the build wrapper to gather compilation database ./build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-outputs -make build-nocheck +make all -# and finally execute the actual SonarQube analysis -sonar-scanner -Dsonar.host.url=https://nemo.sonarqube.org -Dsonar.login=7f3a6edf2fc5fcfa22c3fb95ce13597dc4b1fb15 +# and finally execute the actual SonarQube analysis (the SONAR_TOKEN is set from the travis web interface, to not expose it) +sonar-scanner -Dsonar.host.url=https://nemo.sonarqube.org -Dsonar.login=$SONAR_TOKEN -- 2.20.1