i've finally found how to disable IDE warnings: ``...
# coroutines
d
i've finally found how to disable IDE warnings:
Copy code
compileKotlin {
    kotlinOptions {
        freeCompilerArgs = ['-Xuse-experimental=kotlinx.coroutines.ObsoleteCoroutinesApi']
    }
}
🕵🏼‍♂️ 1
d
I really think it should be in the docs somewhere... I had the same problem.
3
j
Do you know how to do it for maven project?
d
nope, sorry. i hope jb guys will implement ide automatic intention for it
r
If these flags are enabled, it seems like the coroutines API has to be on the build classpath even if the project does not reference them. Is that right?
d
Not sure. There's a KEEP on
use-experimental
though... for me I just put this where I do have it on my classpath.
r
That would be the normal situation, but I have a custom build plugin with common config, and wanted to add these values there (but consumers of the plugin don't necessarily use coroutines).
I ran into build failures for consumers without coroutines
d
I think this has to do with the new experimental flags in Kotlin so it might not be directly linked to coroutines. Maybe in #gradle or #build-tools someone might have a better idea...
r
I think maybe #compiler
BTW, I also added
"-Xuse-experimental=kotlin.Experimental"
to your list above
d
For inline classes and unsigned`s etc...?
r
I was getting a warning with an annotation like
@UseExperimental(ObsoleteCoroutinesApi::class)
🤔 1
I think
UseExperimental
itself needs the flag
d
Oh, that makes sense! Just funny that I don't think I needed it...
r
I guess I should be using
@ObsoleteCoroutinesApi
directly
Yup, that works
p
Any workaround? 1.3.20 sounds like it's far away
l
Adding the compiler options or the annotations to code using it.