Skip to content

Commit 0f5ce90

Browse files
committed
Fix kapt on JDK 16
1 parent 864d75d commit 0f5ce90

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
if: ${{ needs.check_duplicate_workflows.outputs.should_skip != 'true' }}
2424
strategy:
2525
matrix:
26-
java: [ '8', '11', '15' ]
26+
java: [ '8', '11', '16' ]
2727
platform: ['windows-latest', 'ubuntu-latest']
2828
steps:
2929
- uses: actions/checkout@v2
@@ -40,6 +40,17 @@ jobs:
4040
restore-keys: ${{ runner.os }}-gradle
4141
- name: print Java version
4242
run: java -version
43+
- name: Set JVM options for JDK 16
44+
if: ${{ matrix.java == 16 }}
45+
run: echo org.gradle.jvmargs="--illegal-access=permit \
46+
--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
47+
--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
48+
--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
49+
--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
50+
--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
51+
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
52+
--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
53+
--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" >> gradle.properties
4354
- name: Run build
4455
run: ./gradlew clean assemble --info
4556

@@ -49,7 +60,7 @@ jobs:
4960
needs: [build]
5061
strategy:
5162
matrix:
52-
java: [ '8', '11', '15' ]
63+
java: [ '8', '11', '16' ]
5364
platform: ['windows-latest', 'ubuntu-latest']
5465
steps:
5566
- uses: actions/checkout@v2
@@ -68,6 +79,17 @@ jobs:
6879
restore-keys: ${{ runner.os }}-gradle
6980
- name: print Java version
7081
run: java -version
82+
- name: Set JVM options for JDK 16
83+
if: ${{ matrix.java == 16 }}
84+
run: echo org.gradle.jvmargs="--illegal-access=permit \
85+
--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
86+
--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
87+
--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
88+
--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
89+
--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
90+
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
91+
--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
92+
--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" >> gradle.properties
7193
- name: Run test
7294
run: ./gradlew check --info
7395

build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,20 @@ subprojects {
155155
}
156156

157157
sourceCompatibility = 1.8
158+
159+
if (JavaVersion.current() >= JavaVersion.VERSION_16) {
160+
test {
161+
jvmArgs = [
162+
"--illegal-access=permit",
163+
"--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
164+
"--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
165+
"--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED",
166+
"--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED",
167+
"--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED",
168+
"--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED",
169+
"--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
170+
"--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
171+
]
172+
}
173+
}
158174
}

0 commit comments

Comments
 (0)