From 8a1ed1d0468fbb4d2bbd800e5888f9dbf860e734 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Fri, 2 Oct 2020 11:44:28 +0200 Subject: [PATCH] Fix default to opt-out of bundling Kotlin standard library in plugin distribution --- CHANGELOG.md | 3 +++ README.md | 16 +++++++++++++++- gradle.properties | 4 ++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffc8713..4ca1d91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ # IntelliJ Platform Plugin Template Changelog ## [Unreleased] +### Added +- Fix default to opt-out of bundling Kotlin standard library in plugin distribution + ### Changed - GitHub Actions: allow releasing plugin even for the base project - Dependencies - upgrade `org.jetbrains.kotlin.jvm` to 1.4.10 diff --git a/README.md b/README.md index f48b2d5..acf09f6 100644 --- a/README.md +++ b/README.md @@ -70,10 +70,23 @@ The project-specific configuration file [gradle.properties][file:gradle.properti | `pluginUntilBuild` | The `until-build` attribute of the tag. | | `platformType` | The type of IDE distribution. | | `platformVersion` | The version of the IntelliJ Platform IDE that will be used to build the plugin. | -| `platformDownloadSources` | IDE sources downloaded while initializing the Gradle build. | +| `platformDownloadSources` | IDE sources downloaded while initializing the Gradle build. | The properties listed define the plugin itself or configure the [gradle-intellij-plugin][gh:gradle-intellij-plugin] – check its documentation for more details. +### Dependency on the Kotlin standard library + +Since Kotlin 1.4, a dependency on a standard library (`stdlib`) is added automatically. +In most cases, it is not necessary to distribute this library with a plugin. + +The [gradle.properties][file:gradle.properties] file explicitly alters the default behaviour of the Kotlin Gradle plugin by specifying this opt-out property: + +``` +kotlin.stdlib.default.dependency = false +``` + +For more details, please see: [Dependency on the standard library][kotlin-docs-dependency-on-stdlib] in Kotlin documentation~~~~. + ## Plugin template structure A generated IntelliJ Platform Plugin Template repository contains the following content structure: @@ -247,3 +260,4 @@ You can get that token in the [My Tokens][jb:my-tokens] tab within your Marketpl [detekt]: https://detekt.github.io/detekt [gradle]: https://gradle.org [gradle-kotlin-dsl]: https://docs.gradle.org/current/userguide/kotlin_dsl.html +[kotlin-docs-dependency-on-stdlib]: https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library diff --git a/gradle.properties b/gradle.properties index 9abc9a9..840cbd5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,3 +10,7 @@ pluginUntilBuild = 202.* platformType = IC platformVersion = 2019.3 platformDownloadSources = true + +# Opt-out flag for bundling Kotlin standard library. +# See https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details. +kotlin.stdlib.default.dependency = false