We want to treat warnings as errors to improve code quality, so we’re using the allWarningsAsErrors
compiler option in Gradle. We’ve cleaned up our project, but the problem is that we have these two last remaining warnings in dependent library, which we need to suppress:
e: warnings found and -Werror specified
w: /Users/richie/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.20/1ba23e74292b5af8980efde762fdd44fb61ddc2/kotlin-stdlib-jre7-1.2.20.jar: kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead
w: /Users/richie/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre8/1.2.20/f77d7863695e17041b50ebe5e2f87e5314a2c812/kotlin-stdlib-jre8-1.2.20.jar: kotlin-stdlib-jre8 is deprecated. Please use kotlin-stdlib-jdk8 instead
We cannot use a source code suppression (@Suppress
annotation), because these JRE warnings are not associated with a line or file.
So how do we suppress these warnings so that we can treat all “real” warnings as errors.