Kotlin / kotlin-frontend-plugin

Gradle Kotlin (http://kotlinlang.org) plugin for frontend development
Apache License 2.0
561 stars 69 forks source link

How to apply the plugin with the Gradle Plugins DSL? #116

Closed lamba92 closed 5 years ago

Bluexin commented 5 years ago

In your settings.gradle, add proper resolution for it. This is an example for settings.gradle.kts, translating it to groovy shouldn't be too hard :

val kotlin_frontend_version: String by settings

pluginManagement {
    repositories {
        gradlePluginPortal()
        maven {
            name = "Kotlin EAP (for kotlin-frontend-plugin)"
            url = uri("https://dl.bintray.com/kotlin/kotlin-eap")
        }
    }
    resolutionStrategy {
        eachPlugin {
            when (requested.id.id) {
                "org.jetbrains.kotlin.frontend" -> useModule("org.jetbrains.kotlin:kotlin-frontend-plugin:$kotlin_frontend_version")
                // Other custom plugin resolution
            }
        }
    }
}

Then in build.gradle (again, this is kts, but it's pretty much the same) :

plugins {
    id("org.jetbrains.kotlin.frontend")
}