2021-06-20 16:31:08 +02:00
|
|
|
/**
|
|
|
|
* This module provides a base for for pure kotlin modules
|
|
|
|
*/
|
2018-10-06 13:37:12 +02:00
|
|
|
apply plugin: 'kotlin'
|
2021-06-20 16:31:08 +02:00
|
|
|
apply plugin: 'kotlin-kapt'
|
2018-10-06 13:37:12 +02:00
|
|
|
apply plugin: 'jacoco'
|
|
|
|
apply from: "${project.rootDir}/gradle_scripts/code_quality.gradle"
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main.java.srcDirs += "${projectDir}/src/main/kotlin"
|
|
|
|
test.java.srcDirs += "${projectDir}/src/test/kotlin"
|
|
|
|
test.java.srcDirs += "${projectDir}/src/integrationTest/kotlin"
|
|
|
|
test.resources.srcDirs += "${projectDir}/src/integrationTest/resources"
|
|
|
|
}
|
|
|
|
|
2018-10-06 14:49:06 +02:00
|
|
|
|
2018-10-06 13:37:12 +02:00
|
|
|
dependencies {
|
|
|
|
api other.kotlinStdlib
|
2018-10-06 14:49:06 +02:00
|
|
|
|
|
|
|
testImplementation testing.junit
|
|
|
|
testRuntimeOnly testing.junitVintage
|
2018-10-06 13:37:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
jacoco {
|
|
|
|
toolVersion(versions.jacoco)
|
|
|
|
}
|
|
|
|
|
|
|
|
ext {
|
|
|
|
// override it in the module
|
2020-08-24 13:59:40 +02:00
|
|
|
jacocoExclude = ['jdk.internal.*']
|
2018-10-06 13:37:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
jacocoTestReport {
|
|
|
|
reports {
|
2021-10-13 19:06:42 +02:00
|
|
|
html.required = true
|
|
|
|
xml.required = false
|
|
|
|
csv.required = false
|
2018-10-06 13:37:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
afterEvaluate {
|
2020-06-13 19:04:31 +02:00
|
|
|
getClassDirectories().setFrom(files(classDirectories.files.collect {
|
2018-10-06 13:37:12 +02:00
|
|
|
fileTree(dir: it, excludes: jacocoExclude)
|
2020-06-13 19:04:31 +02:00
|
|
|
}))
|
2018-10-06 13:37:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-06 20:17:32 +02:00
|
|
|
tasks.named("test").configure {
|
|
|
|
useJUnitPlatform()
|
2018-10-06 13:37:12 +02:00
|
|
|
jacoco {
|
|
|
|
excludes += jacocoExclude
|
2020-08-24 13:59:40 +02:00
|
|
|
includeNoLocationClasses = true
|
2018-10-06 13:37:12 +02:00
|
|
|
}
|
2021-05-06 20:17:32 +02:00
|
|
|
finalizedBy jacocoTestReport
|
2018-10-06 13:37:12 +02:00
|
|
|
}
|
|
|
|
|
2021-05-06 20:17:32 +02:00
|
|
|
tasks.register("ciTest") {
|
|
|
|
dependsOn test
|
2018-10-06 13:37:12 +02:00
|
|
|
group = "Verification"
|
|
|
|
description = "Special task for CI that calls all tests in pure kotlin modules"
|
|
|
|
}
|