How to suppress deprecations
in for KotlinCompile
in Gradle
similar to JavaCompile
?
JavaCompile(works):
tasks.withType(JavaCompile) {
configure(options) {
compilerArgs << '-Xlint:-deprecation'
}
}
KotlinCompile(does not work):
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions {
freeCompilerArgs = ["-Xjavac-arguments=-Xlint:-deprecation"]
}
}
References:
Similar questions:
- kotlin supress warning deprecated for android
- Mark unused parameters in Kotlin
- Kotlin: Suppress unused Property?
- How do I make the Kotlin compiler treat warnings as errors?