Use travis built-in SonarCloud support

This commit is contained in:
Gary Tierney
2018-08-23 22:55:44 +01:00
parent 03786a6314
commit 5346eab529
3 changed files with 24 additions and 4 deletions
+7 -1
View File
@@ -1,10 +1,16 @@
language: java
jdk:
- oraclejdk8
addons:
sonarcloud:
organization: "github-apollo-rsps"
after_success:
- ./gradlew jacocoTestReport
- bash <(curl -s https://codecov.io/bash)
- ./gradlew -Dsonar.organization=github-apollo-rsps -Dsonar.host.url=https://sonarcloud.io -Dsonar.login="$SONARCLOUD_TOKEN" sonarqube
- git fetch --unshallow
- ./gradlew -Dsonar.host.url=https://sonarcloud.io -Dsonar.login="$SONAR_TOKEN" sonarqube
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
+1 -1
View File
@@ -17,5 +17,5 @@ allprojects {
}
apply from: 'gradle/properties.gradle'
apply from: 'gradle/jacoco.gradle'
apply from: 'gradle/quality-gate.gradle'
apply from: 'gradle/wrapper.gradle'
@@ -5,7 +5,6 @@ def testedProjects() {
}
gradle.projectsEvaluated {
configure(testedProjects()) {
apply plugin: 'jacoco'
@@ -19,11 +18,17 @@ gradle.projectsEvaluated {
}
test {
reports {
junitXml.enabled = true
html.enabled = false
}
jacoco {
append = false
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
}
}
@@ -35,7 +40,7 @@ gradle.projectsEvaluated {
reports {
xml.enabled = true
html.enabled = true
html.enabled = false
}
testedProjects().each { subproject ->
@@ -54,5 +59,14 @@ gradle.projectsEvaluated {
executionData = execData
}
sonarqube {
properties {
property "sonar.organization", "github-apollo-rsps"
property "sonar.projectKey", "apollo:org.apollo"
property "sonar.projectName", "Apollo RSPS"
property "sonar.kotlin.file.suffixes", ".kt,.kts"
}
}
project.tasks["sonarqube"].dependsOn(jacocoTestReport)
}