File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ plugins {
44 id ' eclipse'
55 id ' idea'
66 id ' maven-publish'
7+ id ' jacoco'
78 alias libs. plugins. modDevGradle
89 // alias libs.plugins.shadow
910 alias libs. plugins. spotless
@@ -98,3 +99,34 @@ tasks.withType(JavaCompile).configureEach {
9899lombok {
99100 version = " 1.18.38"
100101}
102+
103+ jacoco {
104+ applyTo runGameTestServer
105+ }
106+
107+ jacocoTestReport {
108+ doFirst {
109+ try {
110+ runGameTestServer. exec()
111+ } catch (RuntimeException ignored) {}
112+ }
113+ doLast {
114+ println " Coverage report location:"
115+ println " - file://${ layout.buildDirectory.dir('coverage').map(a -> a.file('index.html')).get()} "
116+ println " - file://${ layout.buildDirectory.dir('coverage').map(a -> a.file('coverage.xml')).get()} "
117+ }
118+ executionData runGameTestServer
119+ sourceSets sourceSets. test
120+ reports {
121+ csv. required = false
122+ xml. required = true
123+ html. outputLocation = layout. buildDirectory. dir(' coverage' )
124+ xml. outputLocation = layout. buildDirectory. dir(' coverage' ). map(a -> a. file(' coverage.xml' ))
125+ }
126+ afterEvaluate {
127+ classDirectories. setFrom(files(classDirectories. files. collect {
128+ fileTree(dir : it, exclude : ' **/client/**' )
129+ fileTree(dir : it, exclude : ' **/mixins/**' )
130+ }))
131+ }
132+ }
You can’t perform that action at this time.
0 commit comments