Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonarqube improvements
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 26 May 2016 21:51:27 +0000 (23:51 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 26 May 2016 22:27:10 +0000 (00:27 +0200)
- 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
sonar-project.properties [new file with mode: 0644]
tools/internal/travis-sonarqube.sh

index 5a55cd1..ba6eb86 100644 (file)
@@ -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 (file)
index 0000000..1b25f0e
--- /dev/null
@@ -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
index 8075f4a..45c23c6 100755 (executable)
@@ -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