kotlinx-benchmark icon indicating copy to clipboard operation
kotlinx-benchmark copied to clipboard

kotlinx-benchmark Gradle plugin should use Gradle's embedded Kotlin

Open adam-enko opened this issue 7 months ago • 0 comments

Currently the kxb Gradle plugin uses Kotlin Gradle Plugin to compile the project.

https://github.com/Kotlin/kotlinx-benchmark/blob/0764551f1dde18955f986fbf1dd581449202a23f/plugin/build.gradle#L19-L25

However, Gradle uses an embedded version of Kotlin.

Using KGP is problematic for a few reasons.

  • KGP adds dependencies that might clash with other Gradle plugins (e.g. adds kotlin-stdlib as a dependency, but this will be provided by Gradle.)
  • kxb Gradle misses compiler arguments (e.g. -java-parameters) that maximise compatibility with other Gradle plugins.

In order to maximise compatibility with Gradle, kxb Gradle should use the kotlin-dsl plugin instead of KGP. (This might lead to lots of code changes though, because it applies sam-with-receiver - a quicker fix would be to use embedded-kotlin instead of KGP.)

adam-enko avatar Jul 11 '24 09:07 adam-enko