diff --git a/.github/workflows/errorprone.yml b/.github/workflows/errorprone.yml index a0111b86..81e287a5 100644 --- a/.github/workflows/errorprone.yml +++ b/.github/workflows/errorprone.yml @@ -11,4 +11,4 @@ jobs: with: fetch-depth: 10 - name: Check - run: ./gradlew compileJava -PenableErrorProne + run: ./gradlew compileJava -PenableErrorProne -PWerror diff --git a/build.gradle.kts b/build.gradle.kts index 8d623f35..06491022 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -229,7 +229,10 @@ allprojects { } } tasks.withType().configureEach { - options.compilerArgs.addAll(listOf("-Xmaxerrs", "10000", "-Xmaxwarns", "10000", "-Werror")) + options.compilerArgs.addAll(listOf("-Xmaxerrs", "10000", "-Xmaxwarns", "10000")) + if (props.bool("Werror", false)) { + options.compilerArgs.add("-Werror") + } options.errorprone { errorproneArgs.add("-XepExcludedPaths:.*/javacc/.*") disableWarningsInGeneratedCode.set(true)