mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Fix merging of JaCoCo reports
This commit is contained in:
+32
-35
@@ -1,4 +1,4 @@
|
||||
apply plugin: 'jacoco'
|
||||
apply plugin: "jacoco"
|
||||
|
||||
def jacocoCoverageAggregate = "$buildDir/jacoco/jacocoTestAll.exec"
|
||||
|
||||
@@ -6,46 +6,43 @@ def testedProjects() {
|
||||
subprojects.findAll { subproject -> subproject.plugins.hasPlugin('java') || subproject.plugins.hasPlugin('kotlin') }
|
||||
}
|
||||
|
||||
configure(testedProjects()) {
|
||||
|
||||
jacoco {
|
||||
toolVersion = '0.8.1'
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
|
||||
classDirectories = files(sourceSets.main.output)
|
||||
}
|
||||
|
||||
test {
|
||||
reports {
|
||||
junitXml.enabled = true
|
||||
html.enabled = false
|
||||
}
|
||||
gradle.projectsEvaluated {
|
||||
configure(testedProjects()) {
|
||||
apply plugin: "jacoco"
|
||||
|
||||
jacoco {
|
||||
append = false
|
||||
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
|
||||
classDumpDir = file("$buildDir/jacoco/classpathdumps")
|
||||
toolVersion = '0.8.1'
|
||||
}
|
||||
|
||||
test {
|
||||
reports {
|
||||
junitXml.enabled = true
|
||||
html.enabled = false
|
||||
}
|
||||
|
||||
jacoco {
|
||||
append = false
|
||||
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
|
||||
classDumpDir = file("$buildDir/jacoco/classpathdumps")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task jacocoMerge(type: JacocoMerge) {
|
||||
destinationFile = file(jacocoCoverageAggregate)
|
||||
executionData = project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
|
||||
}
|
||||
|
||||
sonarqube {
|
||||
properties {
|
||||
property "sonar.organization", "apollo-rsps"
|
||||
property "sonar.projectKey", "apollo:org.apollo"
|
||||
property "sonar.projectName", "Apollo RSPS"
|
||||
property "sonar.kotlin.file.suffixes", ".kt,.kts"
|
||||
property "sonar.jacoco.reportPaths", jacocoCoverageAggregate
|
||||
task jacocoMerge(type: JacocoMerge) {
|
||||
destinationFile = file(jacocoCoverageAggregate)
|
||||
executionData = project.fileTree(dir: '.', include: '**/build/jacoco/jacocoTest.exec')
|
||||
}
|
||||
|
||||
sonarqube {
|
||||
properties {
|
||||
property "sonar.organization", "apollo-rsps"
|
||||
property "sonar.projectKey", "apollo:org.apollo"
|
||||
property "sonar.projectName", "Apollo RSPS"
|
||||
property "sonar.kotlin.file.suffixes", ".kt,.kts"
|
||||
property "sonar.jacoco.reportPaths", jacocoCoverageAggregate
|
||||
}
|
||||
}
|
||||
|
||||
tasks["sonarqube"].dependsOn(jacocoMerge)
|
||||
}
|
||||
|
||||
tasks["sonarqube"].dependsOn(jacocoMerge)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user