Skip to content

Instantly share code, notes, and snippets.

@dirkraft
Last active July 6, 2017 19:57
Show Gist options
  • Save dirkraft/dbfb3d0c6fa7e6113e2648c06e7c44eb to your computer and use it in GitHub Desktop.
Save dirkraft/dbfb3d0c6fa7e6113e2648c06e7c44eb to your computer and use it in GitHub Desktop.
Gradle Kotlin support.
/*
# Put this in root build.gradle
buildscript {
ext.kotlin_version = '1.1.3-2'
repositories { mavenCentral() }
dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }
}
# Then in each project build.gradle where desired:
apply from: '../gradle/kotlin.gradle'
*/
apply plugin: 'kotlin'
sourceCompatibility = 1.8
targetCompatibility = sourceCompatibility
compileKotlin { kotlinOptions.jvmTarget = sourceCompatibility }
compileTestKotlin { kotlinOptions.jvmTarget = sourceCompatibility }
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'org.slf4j:slf4j-api:1.7.22'
runtime group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.1'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile 'com.nhaarman:mockito-kotlin:1.3.0'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment