I got this at the moment, but that doesn’t work: `...
# announcements
h
I got this at the moment, but that doesn’t work:
Copy code
plugins {
    id("org.jetbrains.kotlin.js") version "1.3.60-eap-76"
}

repositories {
    mavenCentral()
    mavenLocal()
    maven(url = "<https://dl.bintray.com/kotlin/kotlin-eap>")
}
o
I haven’t tried out EAP myself but according to the pinned message in #C0KLZSCHF you can follow the instructions at https://discuss.kotlinlang.org/t/kotlin-1-3-60-early-access-preview/14579
👍 1
h
Can’t get it to work with a Kotlin gradle script. 😕
It works if I use regular gradle script,
o
Don’t have much experience with kotlin gradle scipting either I’m afraid. Maybe someone in #C19FD9681 can help you out?
m
Plugins don't use the same repositories as the one listed there. It's a bit confusing at first. The Build script has it's dependencies/configuration, and your actual build has its. In settings.gradle, add
Copy code
pluginManagement {
    repositories {
        maven(url = "<https://dl.bintray.com/kotlin/kotlin-eap>")
    }
}
Although that's acceptable for Groovy so may have to tweak a bit for Kotlin DSL.
It was clearer when they used the
buildscript
block, but also more clutter in your main build file.
h
wait, so with Kotlin Gradle script you don’t use
buildscript
anymore?
Also, why settings.gradle? Why can’t I put that in build.gradle.kts?
m
No, it's not Kotlin Gradle that changed this. You have 2 ways to bring plugins into your build. Either with buildscript OR using the
plugins
block. The
plugins
block is the recommended approach now. It can speed up build configuration phase BUT does have some syntax restrictions as a result. Won't go into details here. If you use buildscript, then everything is in the build.gradle file. If you use
plugins
, then plugin configuration goes into the settings file.
If you go to the end of the
Limitations of the plugins DSL
section, you'll see this
If the restrictions of the plugins {} block are prohibitive, the recommended approach is to apply plugins using the buildscript {} block
👍 1