diff --git a/.travis.yml b/.travis.yml index f941888..d1a5740 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,9 @@ language: java +addons: + sonarcloud: + organization: "ethauvin-github" + jdk: - oraclejdk8 - openjdk12 @@ -9,9 +13,6 @@ before_install: after_success: - | - if [ "${TRAVIS_PULL_REQUEST}" != "false" ] && [ "$TRAVIS_JDK_VERSION" == oraclejdk8 ]; then - ./gradlew sonarqube \ - -Dsonar.github.pullRequest=${TRAVIS_PULL_REQUEST} \ - -Dsonar.github.oauth=${SONAR_GITHUB} \ - -Dsonar.login=${SONAR_TOKEN} + if [ "${TRAVIS_TEST_RESULT}" == 0 ] && [ "$TRAVIS_JDK_VERSION" == oraclejdk8 ]; then + ./gradlew sonarqube fi diff --git a/build.gradle b/build.gradle index 4cffbef..1f3548d 100644 --- a/build.gradle +++ b/build.gradle @@ -69,6 +69,7 @@ test { } compileJava { + dependsOn('incrementBuildMeta') options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation' } @@ -99,8 +100,10 @@ incrementBuildMeta { } } -compileJava { - dependsOn('incrementBuildMeta') +sonarqube { + properties { + property "sonar.projectKey", "ethauvin_mobibot" + } } tasks.withType(SpotBugsTask) { diff --git a/sonar-project.properties b/sonar-project.properties index 27314ec..e69de29 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,2 +0,0 @@ -sonar.projectKey=ethauvin_semver -sonar.sourceEncoding=UTF-8