What's the idiomatic way of enabling experimental ...
# kotlin-dsl
m
What's the idiomatic way of enabling experimental kotlin features like
when guard statements
for a gradle project (module)?
m
If anyone is interested there is a type-safe way that avoids using
freeCompilerArgs
Copy code
kotlin {
    sourceSets.all {
        languageSettings.enableLanguageFeature(LanguageFeature.ExplicitBackingFields.name)
        languageSettings.enableLanguageFeature(LanguageFeature.WhenGuards.name)
    }
}
Not sure if idiomatic or not, I don't like the fact I can't specify features in bulk but seems to be a good way forward considering it's compatible with KMP projects and type-safe The only drawback I see at the moment is kind of ugly import statement inside
gradle.build.kts