From 4b7ddb0c0bd12fa636f9cbd359d9c5c1c629e16a Mon Sep 17 00:00:00 2001 From: Adam <152864218+adam-enko@users.noreply.github.com> Date: Mon, 24 Nov 2025 12:23:37 +0100 Subject: [PATCH] Gradle plugin: change kotlin-reflect from implementation to compileOnly The only usage of Kotlin Reflect is inside a Worker[1], so the classpath is isolated. This means the Kotlin Reflect dependency can be changed from `implementation` to `compileOnly`. To avoid clashes with Gradle's embedded Kotlin, and with other plugins, Gradle plugins should avoid using unnecessary dependencies. Continuation of #229 [1] https://github.com/Kotlin/kotlinx-benchmark/blob/e9becb5101be4e458e1cfcd07936571f85bcb569/plugin/main/src/kotlinx/benchmark/gradle/JmhBytecodeGeneratorWorker.kt#L187 --- plugin/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index 586cff62..3610fc79 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -105,7 +105,7 @@ kotlin { } dependencies { - implementation(libs.kotlin.reflect) + compileOnly(libs.kotlin.reflect) implementation(libs.squareup.kotlinpoet)