From af29af455866a3f4c82bb6eb10af0acc53b7f42f Mon Sep 17 00:00:00 2001 From: Martin Bonnin Date: Tue, 29 Jul 2025 09:31:13 +0200 Subject: [PATCH] Nicer kotlin {} block and mention languageVersion --- docs/plugin-development/kotlin-plugins.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/plugin-development/kotlin-plugins.md b/docs/plugin-development/kotlin-plugins.md index 33bff6c..53bca31 100644 --- a/docs/plugin-development/kotlin-plugins.md +++ b/docs/plugin-development/kotlin-plugins.md @@ -26,12 +26,13 @@ plugins { id("java-gradle-plugin") } -tasks.withType().configureEach { - // But make sure your plugin code only uses 1.9 APIs - compilerOptions.apiVersion.set(KotlinVersion.KOTLIN_1_9) -} - kotlin { + compilerOption { + // Make sure your plugin code only uses 1.9 APIs + apiVersion.set(KotlinVersion.KOTLIN_1_9) + // Make sure your older Gradle versions can compile build.gradle.kts scripts against your plugin. + languageVersion.set(KotlinVersion.KOTLIN_1_9) + } // Also make sure to depend on 1.9 kotlin-stdlib // See also https://youtrack.jetbrains.com/issue/KT-53462 coreLibrariesVersion = "1.9.24"