What's the difference between setting `languageSet...
# gradle
w
What's the difference between setting
languageSettings.optIn
and configuring all
KotlinCompilationTasks<*>
with
compilerOptions.freeCompilerArgs.add("opt-in=...")
? I'm looking at https://kotlinlang.org/docs/opt-in-requirements.html#module-wide-opt-in to add module-with opt-in annotation
t
Generally there no difference. Though
languageSettings
most probably will be deprecated in 1.9.20 in favor of
compilerOptions
Plus
compilerOptions
since 1.9.0 should contain
optIn: ListProperty<String>
option.
j
Is it possible to expose publicly any compiler option? I mean, if I want to add context receivers or whatever, I need to know the exact name, it should be great something like
compilerOptions.contextReceivers.isEnabled.set(true)
t
kind of planned to introduce experimental compiler options inside
compilerOptions
, but not in the nearest release
For now top-priority is Kotlin/MPP plugin project options and then native link task stable compiler options. After it we will work on exposing experimental compiler options
w
Thanks helpful, thank you! 🙂
j
@tapchicoma until which point it is interesting to maintain two (or more) plugins instead of keeping only the KMP one with only JVM target selected by the consumer? Based on an Elizarov YouTube short, I see that as the future 🤔 (sorry for the offtopic)
s
For multiplatform projects, iirc, compilerOptions might not be properly imported into the IDE for shared Source Sets (e.g. commonMain) I personally used languageSettings for those.