Javier
11/17/2021, 3:01 PMExperimentalMaterialApi
?
The project is KMP, I know the sourceSets.all.lanaguageSettings
is the multiplatform way, but both are not working for me, not sure what is the issue but I can only remove the error by adding the OptInt(...)
to the composable function
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += "-opt-in=androidx.compose.material.ExperimentalMaterialApi"
}
kotlin {
android()
jvm()
sourceSets {
all {
languageSettings.optIn("androidx.compose.material.ExperimentalMaterialApi")
}
...
}
}
len
11/17/2021, 3:19 PMlanguageSettings.optIn("kotlin.RequiresOptIn")
Javier
11/17/2021, 3:19 PMlen
11/17/2021, 3:22 PMsubprojects {
plugins.withType<org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper> {
configure<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension> {
sourceSets.all {
languageSettings {
optIn("kotlin.RequiresOptIn")
optIn("kotlin.ExperimentalStdlibApi")
// remaining opt-ins
}
}
}
}
}
ephemient
11/17/2021, 3:24 PMlanguageSettings.optIn
doesn't work, but
kotlin {
targets.all {
compilations.all {
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}
}
shouldJavier
11/17/2021, 3:29 PMlen
11/17/2021, 3:30 PMX
from -X
, but languageSettings should work š¤Javier
11/17/2021, 3:31 PM