Skip to content

Commit

Permalink
Open packages to google-java-format; JDK 11 build requirement
Browse files Browse the repository at this point in the history
* The workaround to make google-java-format work described in
  diffplug/spotless#834 requires raising
  the minimum build requirement to JDK 11.
* Runtime compatibility with JDK 8 is ensured by using the
  '--release' compiler flag.
  • Loading branch information
A248 committed May 21, 2021
1 parent fd51a8b commit fb6ce0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11', '16' ]
java: [ '11', '16' ]

steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 1 addition & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ javadoc.options.encoding = 'UTF-8'
jacoco { toolVersion = '0.8.7' }

tasks.withType(JavaCompile) {
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
options.release = 8
}
options.release = 8
options.compilerArgs += [
'-Xlint:unchecked',
'-Xlint:cast',
Expand Down Expand Up @@ -161,9 +159,6 @@ javadoc { exclude '**/internal/**' }

dependencies {
errorprone("com.google.errorprone:error_prone_core:2.7.1")
if (JavaVersion.current().isJava8()) {
errorproneJavac("com.google.errorprone:javac:9+181-r4173-1")
}

antlr 'org.antlr:antlr4'

Expand Down
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

0 comments on commit fb6ce0a

Please sign in to comment.