Provides the Kotlin plugin via the Gradle plugin portal, and adds ergonomic improvements over the default plugin:
- Automatically depends on the standard library
- Allows Kotlin library versions to be omitted, inferring them automatically from the plugin version
- For Kotlin 1.1 and later, sets the
-jvm-targetand uses the jre standard library based on thesourceCompatibility
The plugin simplifies a basic Kotlin build script to:
plugins {
id 'nebula.kotlin' version '1.0.5'
}
repositories {
mavenCentral() // or jcenter()
}plugins {
id 'nebula.kotlin' version '1.0.5'
}
repositories {
mavenCentral() // or jcenter()
}
dependencies {
compile 'org.jetbrains.kotlin:kotlin-reflect'
}The version for kotlin-reflect will be automatically set to match the Kotlin version (1.0.5).
Milestone plugin versions are also available, but require the milestone bintray repository for the Kotlin Gradle plugin dependencies to resolve. For example, for the 1.1 milestones on On Gradle 2.14 and later, use:
pluginRepositories {
maven {
url 'https://dl.bintray.com/kotlin/kotlin-eap-1.1'
}
gradlePluginPortal()
}On earlier releases:
buildscript {
repositories.maven { url 'https://dl.bintray.com/kotlin/kotlin-eap-1.1' }
}- IntelliJ doesn't set the
-jvm-targetcompiler option based on the Java SDK setting for the project, and can cause the compiler inlining failure if it tries to inline classes compiled with Gradle. Add-jvm-target 1.8to the Kotlin Compiler options in IntelliJ to avoid the issue - Our plugin versioning is strict semver, so while the Kotlin releases are
1.1-M04ours are1.1.0-M04.