mirror of
https://github.com/ultrasonic/ultrasonic
synced 2024-12-11 08:28:11 +01:00
61 lines
1.3 KiB
Groovy
61 lines
1.3 KiB
Groovy
/**
|
|
* This module provides a base for for pure kotlin modules
|
|
*/
|
|
apply plugin: 'kotlin'
|
|
apply plugin: 'kotlin-kapt'
|
|
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"
|
|
}
|
|
|
|
|
|
dependencies {
|
|
api libs.kotlinStdlib
|
|
|
|
testImplementation libs.junit
|
|
testRuntimeOnly libs.junitVintage
|
|
}
|
|
|
|
jacoco {
|
|
toolVersion(libs.versions.jacoco.get())
|
|
}
|
|
|
|
ext {
|
|
// override it in the module
|
|
jacocoExclude = ['jdk.internal.*']
|
|
}
|
|
|
|
jacocoTestReport {
|
|
reports {
|
|
html.required = true
|
|
xml.required = false
|
|
csv.required = false
|
|
}
|
|
|
|
afterEvaluate {
|
|
getClassDirectories().setFrom(files(classDirectories.files.collect {
|
|
fileTree(dir: it, excludes: jacocoExclude)
|
|
}))
|
|
}
|
|
}
|
|
|
|
tasks.named("test").configure {
|
|
useJUnitPlatform()
|
|
jacoco {
|
|
excludes += jacocoExclude
|
|
includeNoLocationClasses = true
|
|
}
|
|
finalizedBy jacocoTestReport
|
|
}
|
|
|
|
tasks.register("ciTest") {
|
|
dependsOn test
|
|
group = "Verification"
|
|
description = "Special task for CI that calls all tests in pure kotlin modules"
|
|
}
|