gaetan
07/14/2017, 2:54 PMbashor
07/17/2017, 3:02 PMgaetan
07/17/2017, 3:51 PMbashor
07/17/2017, 7:17 PMimport org.gradle.kotlin.dsl.*
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
buildscript {
repositories {
jcenter()
}
val kotlinVersion by extra { "1.1.3-2" }
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
}
apply {
plugin("kotlin2js")
}
repositories {
jcenter()
}
dependencies {
"compile"(kotlin("stdlib-js"))
}
val compileKotlin2Js: Kotlin2JsCompile by tasks
compileKotlin2Js.kotlinOptions {
sourceMap = true
}
//tasks.withType<Kotlin2JsCompile> {
// kotlinOptions.sourceMap = true
//}
//
//tasks.getByName("compileKotlin2Js") {
// this as Kotlin2JsCompile
// kotlinOptions.sourceMap = true
//}
ilya.chernikov
07/17/2017, 7:34 PMgaetan
07/18/2017, 4:31 PMplugins {
id "org.jetbrains.kotlin.jvm" version "<version to use>"
}
bashor
07/18/2017, 4:49 PMgaetan
07/18/2017, 5:15 PMbashor
07/18/2017, 5:17 PMplugins {
id ...
}
gaetan
07/18/2017, 5:25 PMbashor
07/18/2017, 5:44 PMgaetan
07/18/2017, 5:53 PMTo target the JVM, the Kotlin plugin needs to be applied:
apply plugin: "kotlin"
Or, starting with Kotlin 1.1.1, the plugin can be applied using the Gradle plugins DSL:
plugins {
id "org.jetbrains.kotlin.jvm" version "<version to use>"
}
I understand “there is just one plugin” with 2 ways of applying it.bashor
07/18/2017, 5:55 PMgaetan
07/18/2017, 5:56 PM