efemoney
06/11/2019, 1:42 PMuse-experimental
compiler argument either does not work as advertised (has a bug) or is not configured properly. Whats the correct way to configure the use-experimental
compiler argument with gradle (kotlin dsl) such that I do not get warnings for using experimental APIs in my code?
Right now I have this
subprojects {
// ...
project.tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf(
"-Xuse-experimental=kotlin.Experimental,kotlinx.coroutines.ExperimentalCoroutinesApi,kotlinx.serialization.ImplicitReflectionSerializer"
)
}
}
}
in my root build gradle file but I still get warnings like in the attached image (both Flow
and fun dispatcher.invoke( ... )
are experimental APIs)nfrankel
06/11/2019, 3:21 PMefemoney
06/11/2019, 3:21 PMproject.tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf(
"-Xuse-experimental=kotlin.Experimental",
"-Xuse-experimental=kotlinx.serialization.ImplicitReflectionSerializer",
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xuse-experimental=kotlinx.coroutines.FlowPreview"
)
}
}
…no dice.ilya.gorbunov
06/11/2019, 3:55 PMefemoney
06/11/2019, 3:55 PMilya.gorbunov
06/11/2019, 3:58 PMefemoney
06/11/2019, 4:00 PMilya.gorbunov
06/11/2019, 4:01 PMfreeCompilerArgs
with another list?efemoney
06/11/2019, 4:03 PMfreeCompilerArgs
in one location only; within subprojects
block of the root build file. I have also tried wrapping in project.afterEvaluate { ... }
with no luckilya.gorbunov
06/11/2019, 4:14 PMefemoney
06/11/2019, 4:14 PM