Skip to content

Instantly share code, notes, and snippets.

@kevcodez
Last active November 4, 2018 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevcodez/55c5dfc8f6c5cec728e52dbcde144da3 to your computer and use it in GitHub Desktop.
Save kevcodez/55c5dfc8f6c5cec728e52dbcde144da3 to your computer and use it in GitHub Desktop.
Working build script - Jacoco Code Coverage with Kotlin and Gradle 4.9 and Junit 5
buildscript {
ext {
kotlin_version = '1.2.71'
junit_version = '5.3.1'
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
group 'de.foo'
version '1.0-SNAPSHOT'
apply plugin: 'kotlin'
apply plugin: 'jacoco'
sourceCompatibility = 1.8
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
test {
jacoco {
destinationFile = file("${buildDir}/jacoco/test.exec")
}
}
jacoco {
toolVersion = "0.8.2"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment