Last active
November 4, 2018 13:03
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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