Hi we are using play framework, but build with Gradle.
In our gradle build model config, we have
model {
components {
play {
platform play: playVersion, scala: scalaVersion, java: ‘1.8’
injectedRoutesGenerator = true
sources {
twirlTemplates {
defaultImports = TwirlImports.JAVA
}
}
// explicitly exclude functional / integration tests
binaries.all {
tasks.withType(Test) {
exclude('/api/integration/*')
}
}
}
}
}
Now we want to add jacocoTestCoverageVerification like below.
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.7
}
}
}
}
It works fine in our other gradle project. But in play application, not sure how it integrates with play ? Should it be added in model or just normal gradle task ? Actually, it skipped now for no test resource.
Added test resources like below:
test {
useJUnitPlatform()
description ‘Runs the unit tests.’
dependsOn { tasks.compilePlayBinaryTests }
testClassesDir = file("$buildDir/test")
classpath = files ({ testPlayBinary.classpath })
exclude ‘**/Integration’
}
Still didn’t work.
Can anyone help and point me out how to integrate play and jacoco ?
Thanks a lot!