How can I enable <explicit API mode> in Kotlin Mul...
# gradle
a
How can I enable explicit API mode in Kotlin Multiplatform, using the Gradle DSL?
I’ve tried setting the compiler args
Copy code
kotlin {
  targets.configureEach {
    compilations.configureEach {
      kotlinOptions {
        languageVersion = "1.8"
        this.freeCompilerArgs += listOf(
          "-explicit-api", "strict",
          // "-explicit-api=strict",
        )
      }
    }
  }
}
Ah okay, it’s much more simple than I thought
Copy code
kotlin {
  explicitApi()
}
Although, is it possible to only enable this flag for a single source set? I only want to enable it for some generated code, so when I look at it in IntelliJ there’s fewer warnings.
I’ve created an issue for documenting this flag more clearly https://youtrack.jetbrains.com/issue/DOC-16013