Allow switching off the -Werror javac option

This option causes Intellij build to fail if the
'Delegate IDE build/run actions to gradle' box is checked.
We do not know of anyway to change the Intellij behavior.

This change allows an IDE user to prevent -Werror to be passed
to javac by adding a Gradle VM option: -Dno_werror=true
This commit is contained in:
Weimin Yu 2019-06-17 11:26:50 -04:00
parent 7448140e06
commit 46c90133bd

View file

@ -15,6 +15,12 @@ dependencies {
}
tasks.withType(JavaCompile).configureEach {
// The -Werror flag causes Intellij to fail on deprecated api use.
// Allow IDE user to turn off this flag by specifying a Gradle VM
// option from inside the IDE.
if (System.getProperty('no_werror') != 'true') {
options.compilerArgs << "-Werror"
}
options.compilerArgs << "-Werror"
options.errorprone.disableWarningsInGeneratedCode = true
options.errorprone.errorproneArgumentProviders.add([