Skip to content

Instantly share code, notes, and snippets.

@tomekw

tomekw/build.gradle

Created Aug 29, 2018
Embed
What would you like to do?
// build.gradle
buildscript {
// use specific Kotlin version
ext.kotlin_version = '1.2.61'
}
plugins {
// install Kotlin JVM gradle plugin
id 'org.jetbrains.kotlin.jvm' version '1.2.61'
}
repositories {
mavenCentral()
// add Spek 2 development repository
maven { url "https://dl.bintray.com/spekframework/spek-dev" }
}
dependencies {
// include Kotlin standard library
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// include JUnit 5 assertions
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0'
// include Spek 2 library
testImplementation 'org.spekframework.spek2:spek-dsl-jvm:2.0.0-alpha.1'
// include JUnit 5 test engine
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
// include Spek 2 JUnit test engine
testRuntimeOnly 'org.spekframework.spek2:spek-runner-junit5:2.0.0-alpha.1'
}
// configure test task to use Spek 2 test engine with JUnit
test {
useJUnitPlatform {
includeEngines 'spek2'
}
}
// set JVM target to 1.8 for all compilation tasks
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment