You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2023/01/09 17:09:04 UTC

[GitHub] [beam] cushon commented on a diff in pull request #24930: Improve Error Prone configuration

cushon commented on code in PR #24930:
URL: https://github.com/apache/beam/pull/24930#discussion_r1064875307


##########
buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy:
##########
@@ -1282,6 +1283,27 @@ class BeamModulePlugin implements Plugin<Project> {
         options.errorprone.disableWarningsInGeneratedCode = true
         options.errorprone.excludedPaths = '(.*/)?(build/generated-src|build/generated.*avro-java|build/generated)/.*'
 
+        // Error Prone requires some packages to be exported/opened for Java 17.
+        // This logic handles builds running on JDK 17, notusing -Djava17Home.
+        // The -J prefix is not needed if forkOptions.javaHome is unset,
+        // see http://github.com/gradle/gradle/issues/22747
+        if (JavaVersion.VERSION_1_8.compareTo(JavaVersion.current()) < 0

Review Comment:
   I update the comment. The flags should be passed to all Java versions that support modules (Java 9 and up), and became mandatory for Java 17 and newer versions. So checking for `version > 8` instead of `version == 17` is deliberate.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org