Skip to content

Instantly share code, notes, and snippets.

@dirkraft
Last active June 23, 2017 15:04
Show Gist options
  • Save dirkraft/6a0139f1833ee2d4e55b1f80b8eba952 to your computer and use it in GitHub Desktop.
Save dirkraft/6a0139f1833ee2d4e55b1f80b8eba952 to your computer and use it in GitHub Desktop.
Minimal Gradle Kotlin support.
/*
# Put this in root build.gradle
buildscript {
ext.kotlin_version = '1.1.2-5'
repositories { mavenCentral() }
dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" }
}
# Then in each project build.gradle where desired:
apply from: '../gradle/kotlin.min.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"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment