It appears that the Kotlin multiplatform Gradle plugin resolves dependencies during the configuration phase.
Looking into the detached configuration, it resolves the Kotlin/Native compiler.
The detached configuration eagerly resolves dependencies here.
Dependency resolution during configuration should be avoided, as dependency resolution is expensive, and the configuration phase runs on every build.
The only steps required to reproduce the issue are to apply the Kotlin multiplatform Gradle plugin, define a target, and ensure that the Kotlin/Native compiler is not already present in KONAN_HOME
(~/.konan/
).
Steps to reproduce:
rm -rf ~/.konan
(or wherever yourKONAN_HOME
is located)./gradlew help --scan