File tree Expand file tree Collapse file tree
smoke-tests/apps/DiagnosticExtension/MockExtension Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ tasks.withType<JavaCompile>().configureEach {
3232 with (options) {
3333 release.set(8 )
3434 compilerArgs.add(" -Werror" )
35+ // We need to support compiling to Java 8 even when using JDK 21 to build.
36+ // Suppress obsolete source/target warning added in JDK 21 while retaining -Werror for everything else.
37+ // This only disables the 'options' lint category (e.g., the obsolete source/target messages).
38+ if (JavaVersion .current().isCompatibleWith(JavaVersion .VERSION_21 )) {
39+ compilerArgs.add(" -Xlint:-options" )
40+ }
3541 }
3642}
3743
Original file line number Diff line number Diff line change @@ -38,6 +38,12 @@ tasks.withType<JavaCompile>().configureEach {
3838 with (options) {
3939 release.set(8 )
4040 compilerArgs.add(" -Werror" )
41+ // We need to support compiling to Java 8 even when using JDK 21 to build.
42+ // Suppress obsolete source/target warning added in JDK 21 while retaining -Werror for everything else.
43+ // This only disables the 'options' lint category (e.g., the obsolete source/target messages).
44+ if (JavaVersion .current().isCompatibleWith(JavaVersion .VERSION_21 )) {
45+ compilerArgs.add(" -Xlint:-options" )
46+ }
4147 }
4248}
4349
Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ tasks.withType<JavaCompile>().configureEach {
1818 with (options) {
1919 release.set(8 )
2020 compilerArgs.add(" -Werror" )
21+ // We need to support compiling to Java 8 even when using JDK 21 to build.
22+ // Suppress obsolete source/target warning added in JDK 21 while retaining -Werror for everything else.
23+ // This only disables the 'options' lint category (e.g., the obsolete source/target messages).
24+ if (JavaVersion .current().isCompatibleWith(JavaVersion .VERSION_21 )) {
25+ compilerArgs.add(" -Xlint:-options" )
26+ }
2127 }
2228}
2329
You can’t perform that action at this time.
0 commit comments