Hi all, When confiugring DCE in Gradle DSL, it no...
# javascript
a
Hi all, When confiugring DCE in Gradle DSL, it now warns about:
This declaration is experimental and its usage should be marked with '@org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalDceDsl' or '@OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalDceDsl::class)'
However, when I mark it with OptIn like so:
Copy code
@OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalDceDsl::class)
dceTask {
then the above warning disappears, but I get a warning for the OptIn itself:
This class can only be used with the compiler argument '-Xopt-in=kotlin.RequiresOptIn'
I already enabled this compiler flag like so:
Copy code
kotlin {
    sourceSets.all {
        languageSettings.optIn("kotlin.RequiresOptIn")
    }
}
However, this seems to enable the OptIn only for the app source code, but not for the Gradle build script itself. How can we enable @OptIn annotation for the Gradle build script itself, so we can annotate the dceTask with OptIn and not in turn get a warning for the OptIn usage?
t
Suppress
works fine 🙂
a
perfect, thx 🙂 👍