jeggy
08/02/2021, 1:02 PMVampire
08/02/2021, 1:45 PMjeggy
08/02/2021, 1:45 PMVampire
08/02/2021, 2:10 PMjava {}
block should better be outside the tasks
block as it is just a bit misleading having it in there,
I don't see tooo much configuration, or actually too much you really need.
Kotlin Gradle plugin with 1.5.30 adds Java Toolchain support, so the three jvmTarget settings probably can be replaced with one setting (https://youtrack.jetbrains.com/issue/KT-43095)
Explicitly specifying the junit-jupiter
engine is not necessary, except if you have multiple JUnit Platform Engines on the class path and want to restrict to only use that one engine, but then why having the other engines on the class path.
The testLogging
and maxHeapSize
settings, well, if you are not happy with the defaults, you need to adjust it, but you can also refactor it into some opinionated convention plugin that you then apply in your builds.
But actually also there you have redundant settings.
For example exceptionFormat = FULL
is the default setting.
Or manually configuring STANDARD_ERROR
and STANDARD_OUT
events is the same as doing showStandardStreams = true
.
Generally said, Gradle loves convention-over-configuration.
It provides sane defaults for most things and if you are happy with them, you don't need much configuration.
But at the same time it is flexible enough to adjust the build to your needs but that you can also factor out into some plugin that you can then cleanly apply to all your projects where you want that configuration.jeggy
08/02/2021, 2:23 PMjeggy
08/02/2021, 2:24 PMjeggy
08/02/2021, 2:24 PMbuild/jacoco/jacoco.xml
Vampire
08/02/2021, 2:36 PMplugins {
jacoco
}
tasks.jacocoTestReport {
reports {
html.required.set(false)
xml.required.set(true)
}
}
iircjeggy
08/02/2021, 5:12 PMgradlew test jacocoTestReport
. Now I got the file