mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 00:38:46 +00:00
Use travis built-in SonarCloud support
This commit is contained in:
+7
-1
@@ -1,10 +1,16 @@
|
|||||||
language: java
|
language: java
|
||||||
jdk:
|
jdk:
|
||||||
- oraclejdk8
|
- oraclejdk8
|
||||||
|
|
||||||
|
addons:
|
||||||
|
sonarcloud:
|
||||||
|
organization: "github-apollo-rsps"
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- ./gradlew jacocoTestReport
|
- ./gradlew jacocoTestReport
|
||||||
- bash <(curl -s https://codecov.io/bash)
|
- 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:
|
before_cache:
|
||||||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||||
|
|||||||
+1
-1
@@ -17,5 +17,5 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
apply from: 'gradle/properties.gradle'
|
apply from: 'gradle/properties.gradle'
|
||||||
apply from: 'gradle/jacoco.gradle'
|
apply from: 'gradle/quality-gate.gradle'
|
||||||
apply from: 'gradle/wrapper.gradle'
|
apply from: 'gradle/wrapper.gradle'
|
||||||
@@ -5,7 +5,6 @@ def testedProjects() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gradle.projectsEvaluated {
|
gradle.projectsEvaluated {
|
||||||
|
|
||||||
configure(testedProjects()) {
|
configure(testedProjects()) {
|
||||||
apply plugin: 'jacoco'
|
apply plugin: 'jacoco'
|
||||||
|
|
||||||
@@ -19,11 +18,17 @@ gradle.projectsEvaluated {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
reports {
|
||||||
|
junitXml.enabled = true
|
||||||
|
html.enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
jacoco {
|
jacoco {
|
||||||
append = false
|
append = false
|
||||||
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
|
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
|
||||||
classDumpDir = file("$buildDir/jacoco/classpathdumps")
|
classDumpDir = file("$buildDir/jacoco/classpathdumps")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,7 +40,7 @@ gradle.projectsEvaluated {
|
|||||||
|
|
||||||
reports {
|
reports {
|
||||||
xml.enabled = true
|
xml.enabled = true
|
||||||
html.enabled = true
|
html.enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
testedProjects().each { subproject ->
|
testedProjects().each { subproject ->
|
||||||
@@ -54,5 +59,14 @@ gradle.projectsEvaluated {
|
|||||||
executionData = execData
|
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)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user