What is the current idiomatic method to apply `@ko...
# compiler
t
What is the current idiomatic method to apply
@kotlin.ExperimentalUnsignedTypes
globally to a whole project, so I don't have to annotate 500+ sites? I had this with gradle compiler options once upon a time, but I think that's evolved and the names may have changed since then (sorry if this belongs in another channel, please direct if so?)
although I’d probably do this instead
Copy code
tasks.withType<KotlinCompile>().configureEach {
  kotlinOptions {
    freeCompilerArgs += listOf(
      "-opt-in=kotlin.ExperimentalUnsignedTypes"
    )
  }
}
because
configureEach {}
is usually better https://melix.github.io/blog/2022/05/gradle-laziness.html
t
Where do I put that at? in the android block of the module gradle file?
b
Copy code
kotlin.sourceSets.all {
  languageSettings.optIn("annotation.package.ClassName")
}
Shove it inside gradle buildfile for each module or inside
allprojects {}
at the root module buildscript
t
Thanks. That worked.