mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
58 lines
1.5 KiB
Groovy
58 lines
1.5 KiB
Groovy
apply plugin: 'jacoco'
|
|
|
|
def testedProjects() {
|
|
subprojects.findAll { subproject -> subproject.plugins.hasPlugin('java') || subproject.plugins.hasPlugin('kotlin') }
|
|
}
|
|
|
|
gradle.projectsEvaluated {
|
|
|
|
configure(testedProjects()) {
|
|
apply plugin: 'jacoco'
|
|
|
|
jacoco {
|
|
toolVersion = '0.8.1'
|
|
}
|
|
|
|
jacocoTestReport {
|
|
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
|
|
classDirectories = files(sourceSets.main.output)
|
|
}
|
|
|
|
test {
|
|
jacoco {
|
|
append = false
|
|
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
|
|
classDumpDir = file("$buildDir/jacoco/classpathdumps")
|
|
}
|
|
}
|
|
}
|
|
|
|
task jacocoTestReport(type: JacocoReport) {
|
|
def tests = []
|
|
def sourceDirs = files()
|
|
def classDirs = files()
|
|
def execData = files()
|
|
|
|
reports {
|
|
xml.enabled = true
|
|
html.enabled = true
|
|
}
|
|
|
|
testedProjects().each { subproject ->
|
|
sourceDirs += files(subproject.sourceSets.main.allSource.srcDirs)
|
|
classDirs += files(subproject.sourceSets.main.output)
|
|
execData += files(subproject.tasks.jacocoTestReport.executionData.findAll {
|
|
it.exists()
|
|
})
|
|
|
|
tests += subproject.tasks.test
|
|
}
|
|
|
|
dependsOn tests
|
|
sourceDirectories = sourceDirs
|
|
classDirectories = classDirs
|
|
executionData = execData
|
|
}
|
|
|
|
|
|
} |