maybe a silly question but: is there a way to set ...
# multiplatform
m
maybe a silly question but: is there a way to set a compiler argument for all the test environments at once or at least knowing which environment I’m missing? example: I’m setting a flag in the tests for Context Receivers (I know they are experimental and going to be supereeded by context parameters but even tho I’m experimenting…) the issue is that I tryed to enable the flag in all the possible environment I can think of but still see the alert:
To use contextual declarations, specify the -Xcontext-receivers compiler option
making me think that I’m still missing one. How can i guess which one? 🙏🏻 thanks
w
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += listOf(
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xexplicit-api=strict",
)
}
❤️ 1
🙏🏻 1
h
Use
configureEach
instead of
all
. Starting with Kotlin 2.0, there is also a new
kotlin.compilerOption
to set up all compilations directly, and the tasks one is deprecated.
👍 1
👍🏻 1
m
nice one, thank you!