How to add opt-in annotation to `build.gradle.kts`...
# compose-desktop
p
How to add opt-in annotation to
build.gradle.kts
? In Android I can use
android.kotlinOptions.freeCompilerArgs += "..."
, in KMM -
kotlin.sourceSets.all.languageSettings.optIn("...")
, but how to do it in compose-desktop?
a
Copy code
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
    kotlinOptions {
        freeCompilerArgs = freeCompilerArgs + "-Xopt-in=kotlin.RequiresOptIn"
    }
}
This also works for Android modules so you can put this in
subprojects
block of your project's root
build.gradle.kts
so that you don't need to add this for every module.
👍 2