[Git][java-team/gradle-kotlin-dsl][master] 4 commits: New patch registering the Kotlin scripting compiler plugin
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Wed Sep 23 17:08:07 BST 2026
Emmanuel Bourg pushed to branch master at Debian Java Maintainers / gradle-kotlin-dsl
Commits:
1832f5c0 by Emmanuel Bourg at 2026-09-23T14:59:34+02:00
New patch registering the Kotlin scripting compiler plugin
- - - - -
f06a1bea by Emmanuel Bourg at 2026-09-23T14:59:34+02:00
Link the Kotlin scripting jars into the Gradle lib directory
- - - - -
6c391524 by Emmanuel Bourg at 2026-09-23T14:59:34+02:00
New patch recognizing the unversioned Kotlin jars of Debian
- - - - -
8a490aa8 by Emmanuel Bourg at 2026-09-23T14:59:34+02:00
New patch reading the class files the way the command line compiler does
- - - - -
7 changed files:
- debian/changelog
- debian/libgradle-kotlin-dsl-java.links
- + debian/patches/05-kotlin-1.3-scripting-plugin.patch
- + debian/patches/06-kotlin-jar-names.patch
- + debian/patches/07-fast-class-files-reading.patch
- debian/patches/series
- debian/rules
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,17 @@
+gradle-kotlin-dsl (0.14.2-2) unstable; urgency=medium
+
+ * New patch registering the Kotlin scripting compiler plugin, required
+ since Kotlin 1.3 to have the build script definitions taken into
+ account
+ * Added the Kotlin scripting jars to the Gradle lib directory
+ * New patch recognizing the unversioned Kotlin jars of Debian, the
+ Kotlin standard library was missing from the build script classpath
+ * New patch reading the class files with the implementation used by
+ the Kotlin command line compiler, string concatenations were
+ rejected in the build scripts
+
+ -- Emmanuel Bourg <ebourg at apache.org> Wed, 23 Sep 2026 14:59:13 +0200
+
gradle-kotlin-dsl (0.14.2-1) unstable; urgency=medium
[ tony mancill ]
=====================================
debian/libgradle-kotlin-dsl-java.links
=====================================
@@ -3,6 +3,10 @@ usr/share/java/gradle-kotlin-dsl-tooling-builders.jar usr/share/gradl
usr/share/java/gradle-kotlin-dsl-tooling-models.jar usr/share/gradle/lib/gradle-kotlin-dsl-tooling-models.jar
usr/share/java/org.jetbrains.annotations-common.jar usr/share/gradle/lib/annotations-13.0.jar
usr/share/java/kotlin-compiler-embeddable.jar usr/share/gradle/lib/kotlin-compiler-embeddable.jar
+usr/share/java/kotlin-scripting-compiler-embeddable.jar usr/share/gradle/lib/kotlin-scripting-compiler-embeddable.jar
+usr/share/java/kotlin-scripting-common.jar usr/share/gradle/lib/kotlin-scripting-common.jar
+usr/share/java/kotlin-scripting-jvm.jar usr/share/gradle/lib/kotlin-scripting-jvm.jar
+usr/share/java/kotlin-scripting-impl.jar usr/share/gradle/lib/kotlin-scripting-impl.jar
usr/share/java/kotlin-reflect.jar usr/share/gradle/lib/kotlin-reflect.jar
usr/share/java/kotlin-sam-with-receiver-compiler-plugin.jar usr/share/gradle/lib/kotlin-sam-with-receiver-compiler-plugin.jar
usr/share/java/kotlin-stdlib.jar usr/share/gradle/lib/kotlin-stdlib.jar
=====================================
debian/patches/05-kotlin-1.3-scripting-plugin.patch
=====================================
@@ -0,0 +1,36 @@
+Description: Register the scripting compiler plugin with the embedded compiler
+ Kotlin 1.2 handled the JVMConfigurationKeys.SCRIPT_DEFINITIONS setting in the
+ compiler itself. Kotlin 1.3 moved that handling to the scripting compiler
+ plugin: ScriptingCompilerConfigurationExtension is what reads the key and
+ hands the definitions to the script definition provider, and it is installed
+ by ScriptingCompilerConfigurationComponentRegistrar.
+ .
+ The plugin is loaded from the command line by the Kotlin compiler, but not
+ when the compiler is embedded as it is here, so the script definition of the
+ build scripts was registered and never read. The Kotlin front-end then found
+ no descriptor for the script and failed with "Descriptor wasn't found for
+ declaration SCRIPT".
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/provider/src/main/kotlin/org/gradle/kotlin/dsl/support/KotlinCompiler.kt
++++ b/provider/src/main/kotlin/org/gradle/kotlin/dsl/support/KotlinCompiler.kt
+@@ -30,6 +30,10 @@
+
+ import org.jetbrains.kotlin.codegen.CompilationException
+
++import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
++
++import org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar
++
+ import org.jetbrains.kotlin.com.intellij.openapi.Disposable
+ import org.jetbrains.kotlin.com.intellij.openapi.project.Project
+ import org.jetbrains.kotlin.com.intellij.openapi.util.Disposer.dispose
+@@ -199,6 +203,8 @@
+ private
+ fun CompilerConfiguration.addScriptDefinition(scriptDef: KotlinScriptDefinition) {
+ add(JVMConfigurationKeys.SCRIPT_DEFINITIONS, scriptDef)
++ add(ComponentRegistrar.PLUGIN_COMPONENT_REGISTRARS,
++ ScriptingCompilerConfigurationComponentRegistrar())
+ }
+
+
=====================================
debian/patches/06-kotlin-jar-names.patch
=====================================
@@ -0,0 +1,19 @@
+Description: Recognize the unversioned Kotlin jars of Debian
+ The Kotlin jars of the Gradle distribution carry their version in their name,
+ for example kotlin-stdlib-1.2.21.jar, and the filter selecting them for the
+ classpath used to compile the build scripts expects the trailing dash. Debian
+ installs them without a version, as kotlin-stdlib.jar and kotlin-reflect.jar,
+ so they were all rejected and the scripts were compiled without the Kotlin
+ standard library: "Cannot access class 'kotlin.Unit'".
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/provider/src/main/kotlin/org/gradle/kotlin/dsl/provider/KotlinScriptClassPathProvider.kt
++++ b/provider/src/main/kotlin/org/gradle/kotlin/dsl/provider/KotlinScriptClassPathProvider.kt
+@@ -158,5 +158,5 @@
+
+ private
+ fun isKotlinJar(name: String): Boolean =
+- name.startsWith("kotlin-stdlib-")
+- || name.startsWith("kotlin-reflect-")
++ name.startsWith("kotlin-stdlib")
++ || name.startsWith("kotlin-reflect")
=====================================
debian/patches/07-fast-class-files-reading.patch
=====================================
@@ -0,0 +1,23 @@
+Description: Read the class files the way the command line compiler does
+ The Kotlin compiler has two implementations for reading class files, and the
+ command line compiler enables the faster one that does not go through the PSI
+ layer. The Kotlin DSL leaves the setting at its default when it embeds the
+ compiler to build the Gradle scripts, and the PSI based reader fails on
+ java.lang.String as soon as its supertypes are resolved: since Java 12 it
+ implements java.lang.constant.ConstantDesc, which the reader does not find.
+ Concatenating two strings in a build script was enough to trigger it.
+ .
+ Upstream never met the problem because Gradle 4.6 was built and run with
+ Java 8, where String has no such supertype.
+Author: Emmanuel Bourg <ebourg at apache.org>
+Forwarded: not-needed
+--- a/provider/src/main/kotlin/org/gradle/kotlin/dsl/support/KotlinCompiler.kt
++++ b/provider/src/main/kotlin/org/gradle/kotlin/dsl/support/KotlinCompiler.kt
+@@ -191,6 +191,7 @@
+ CompilerConfiguration().apply {
+ addKotlinSourceRoots(sourceFiles.map { it.canonicalPath })
+ put<MessageCollector>(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector)
++ put(JVMConfigurationKeys.USE_FAST_CLASS_FILES_READING, true)
+ }
+
+
=====================================
debian/patches/series
=====================================
@@ -2,3 +2,6 @@
02-generate-KotlinDependencyExtensions.patch
03-kotlin-stdlib-jdk.patch
04-gradle-compatibility.patch
+05-kotlin-1.3-scripting-plugin.patch
+06-kotlin-jar-names.patch
+07-fast-class-files-reading.patch
=====================================
debian/rules
=====================================
@@ -20,6 +20,9 @@ override_dh_auto_build:
kotlinc \
-cp 'tooling-models/target/gradle-kotlin-dsl-tooling-models.jar:\
:/usr/share/java/kotlin-compiler-embeddable.jar:\
+ :/usr/share/java/kotlin-scripting-compiler-embeddable.jar:\
+ :/usr/share/java/kotlin-scripting-common.jar:\
+ :/usr/share/java/kotlin-scripting-jvm.jar:\
:/usr/share/kotlin/kotlinc/lib/sam-with-receiver-compiler-plugin.jar:\
:/usr/share/java/atinject-jsr330-api.jar:\
:/usr/share/java/groovy.jar:\
@@ -42,7 +45,7 @@ override_dh_auto_build:
cp -Rp provider/src/main/kotlin/* provider/target/classes
cp -Rp provider/src/main/resources/* provider/target/classes
- printf 'projects=\nruntime=annotations-13.0.jar,gradle-kotlin-dsl-tooling-models.jar,kotlin-compiler-embeddable.jar,kotlin-reflect.jar,kotlin-sam-with-receiver-compiler-plugin.jar,kotlin-stdlib.jar,kotlin-stdlib-jdk7.jar,kotlin-stdlib-jdk8.jar,kotlin-script-runtime.jar,trove4j.jar' \
+ printf 'projects=\nruntime=annotations-13.0.jar,gradle-kotlin-dsl-tooling-models.jar,kotlin-compiler-embeddable.jar,kotlin-scripting-compiler-embeddable.jar,kotlin-scripting-common.jar,kotlin-scripting-jvm.jar,kotlin-scripting-impl.jar,kotlin-reflect.jar,kotlin-sam-with-receiver-compiler-plugin.jar,kotlin-stdlib.jar,kotlin-stdlib-jdk7.jar,kotlin-stdlib-jdk8.jar,kotlin-script-runtime.jar,trove4j.jar' \
> provider/target/classes/gradle-kotlin-dsl-classpath.properties
jar cf provider/target/gradle-kotlin-dsl.jar -C provider/target/classes/ .
View it on GitLab: https://salsa.debian.org/java-team/gradle-kotlin-dsl/-/compare/fd27e2ff17da7957ed266c2cd3e118e8a73a1852...8a490aa86e969220401e7de68d179289b17be787
--
View it on GitLab: https://salsa.debian.org/java-team/gradle-kotlin-dsl/-/compare/fd27e2ff17da7957ed266c2cd3e118e8a73a1852...8a490aa86e969220401e7de68d179289b17be787
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20260923/2b27b496/attachment.htm>
More information about the pkg-java-commits
mailing list