mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 16:51:37 +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"
|
def jacocoCoverageAggregate = "$buildDir/jacoco/jacocoTestAll.exec"
|
||||||
|
|
||||||
@@ -6,46 +6,43 @@ def testedProjects() {
|
|||||||
subprojects.findAll { subproject -> subproject.plugins.hasPlugin('java') || subproject.plugins.hasPlugin('kotlin') }
|
subprojects.findAll { subproject -> subproject.plugins.hasPlugin('java') || subproject.plugins.hasPlugin('kotlin') }
|
||||||
}
|
}
|
||||||
|
|
||||||
configure(testedProjects()) {
|
gradle.projectsEvaluated {
|
||||||
|
configure(testedProjects()) {
|
||||||
jacoco {
|
apply plugin: "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
|
|
||||||
}
|
|
||||||
|
|
||||||
jacoco {
|
jacoco {
|
||||||
append = false
|
toolVersion = '0.8.1'
|
||||||
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
|
|
||||||
classDumpDir = file("$buildDir/jacoco/classpathdumps")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
task jacocoMerge(type: JacocoMerge) {
|
||||||
destinationFile = file(jacocoCoverageAggregate)
|
destinationFile = file(jacocoCoverageAggregate)
|
||||||
executionData = project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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