Compile Kotlin code will all warnings treated as errors

Closes gh-26083
This commit is contained in:
Andy Wilkinson 2021-04-13 20:35:47 +01:00
parent e445179f49
commit ad5ba2e414

View File

@ -25,8 +25,11 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile;
* plugin. When the plugin is applied:
*
* <ul>
* <li>{@link KotlinCompile} tasks are configured to use {@code apiVersion} and
* {@code languageVersion} 1.3.
* <li>{@link KotlinCompile} tasks are configured to:
* <ul>
* <li>Use {@code apiVersion} and {@code languageVersion} 1.3.
* <li>Treat all warnings as errors
* </ul>
* </ul>
*
* <p/>
@ -41,6 +44,7 @@ class KotlinConventions {
KotlinJvmOptions kotlinOptions = compile.getKotlinOptions();
kotlinOptions.setApiVersion("1.3");
kotlinOptions.setLanguageVersion("1.3");
kotlinOptions.setAllWarningsAsErrors(true);
});
});
}