mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 08:39:27 +00:00
0651d535fa
Removes the dependency on legacy script compilation and now relies on script discovery. In addition, the Gradle build scripts were refactored and updated to be compatible with Gradle 5.0 and make use of the new java-library configurations.
59 lines
1.5 KiB
Groovy
59 lines
1.5 KiB
Groovy
apply plugin: "jacoco"
|
|
|
|
allprojects {
|
|
tasks.withType(Test) {
|
|
jacoco {
|
|
toolVersion = '0.8.1'
|
|
}
|
|
|
|
afterEvaluate {
|
|
jacocoTestReport {
|
|
dependsOn tasks.test
|
|
|
|
sourceSets sourceSets.main
|
|
reports {
|
|
html.enabled = true
|
|
xml.enabled = true
|
|
csv.enabled = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
task jacocoTestReport(type: JacocoReport) {
|
|
sourceDirectories = files()
|
|
classDirectories = files()
|
|
executionData = files()
|
|
|
|
reports {
|
|
html.enabled = true
|
|
xml.enabled = true
|
|
csv.enabled = false
|
|
}
|
|
|
|
// Work-around to allow us to build list of executionData files in doFirst
|
|
onlyIf = {
|
|
true
|
|
}
|
|
|
|
/*
|
|
* Builds list of source dirs, class dirs, and executionData files
|
|
* when task is run, not at script evaluation time
|
|
*/
|
|
doFirst {
|
|
subprojects.findAll { subproject ->
|
|
subproject.pluginManager.hasPlugin('java')
|
|
}.each { subproject ->
|
|
additionalSourceDirs files((Set<File>) subproject.sourceSets.main.allJava.srcDirs)
|
|
additionalClassDirs((FileCollection) subproject.sourceSets.main.output)
|
|
if (subproject.pluginManager.hasPlugin('jacoco')) {
|
|
executionData subproject.tasks.jacocoTestReport.executionData
|
|
}
|
|
}
|
|
|
|
executionData = files(executionData.findAll {
|
|
it.exists()
|
|
})
|
|
}
|
|
} |