Purpose of KotlinCompile#kotlinOptions#noStdlib in Gradle Kotlin plugin

What is the purpose of KotlinCompile#kotlinOptions#noStdlib in the Gradle Kotlin plugin?

It defaults to true, but why would I ever set it to false?

1 Like

This flag indicates that the compiler should not include the bundled stdlib into the compilation classpath. At the moment (KGP 1.4.30 and newer) there are no reasons to use this flag. KGP adds the corresponding gradle dependency. If you don’t want to have stdlib in classpath, you could use “kotlin.stdlib.default.dependency=false” property.

2 Likes