Skip to content

Commit c822bb5

Browse files
committed
Add -XDaddTypeAnnotationsToSymbol=true for Error Prone 2.45.0+ JDK 21 compatibility
#4584
1 parent c6287f0 commit c822bb5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

buildSrc/src/main/kotlin/ai.errorprone-conventions.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ val disableErrorProne = properties["disableErrorProne"]?.toString()?.toBoolean()
1313
tasks {
1414
withType<JavaCompile>().configureEach {
1515
with(options) {
16+
// Error Prone 2.45.0+ requires this flag when running on JDK 21
17+
// See: https://github.com/google/error-prone/releases/tag/v2.45.0
18+
compilerArgs.add("-XDaddTypeAnnotationsToSymbol=true")
19+
1620
errorprone {
1721
if (disableErrorProne) {
1822
logger.warn("Errorprone has been disabled. Build may not result in a valid PR build.")

0 commit comments

Comments
 (0)