Commit a8ce88f
authored
Pin the Java toolchain to JDK 21 using
* Use `toolchain { languageVersion = … }` to reliably pin the Java toolchain to JDK 21. This decouples the build from whatever JDK the developer happens to have on `PATH`.
* Disable auto-provisioning of JDKs. Gradle will pick a matching JDK from its detected local JDK installations.
* Drop the manual `JavaVersion.current().isCompatibleWith(VERSION_17)` guard. It is no longer necessary because the toolchain already ensures an appropriate JDK will be used.
* Apply `options.release = 17` to **every** `JavaCompile` task. Previously it was only `compileJava`, so tests were actually targeting Java 21.
* In `PendingWritesQueueConcurrencyTest`, remove an inadvertent dependency on the JDK 19 API (namely, a try-with-resources statement taking advantage of `ExecutorService` being auto-closeable) in order to make it compile under `--release 17`.
Apart from pinning the JDK cleanly, toolchains also interact better with the Build Cache. Gradle folds the toolchain JDK identity into the build cache key, so cached compile outputs are tied to the JDK that produced them rather than just to `javac` arguments.java { toolchain {…} } (#4366)1 parent 02fa096 commit a8ce88f
3 files changed
Lines changed: 32 additions & 25 deletions
File tree
- fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/queue
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
200 | 207 | | |
201 | 208 | | |
202 | 209 | | |
| |||
256 | 263 | | |
257 | 264 | | |
258 | 265 | | |
259 | | - | |
260 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
261 | 270 | | |
262 | 271 | | |
263 | | - | |
| 272 | + | |
264 | 273 | | |
265 | 274 | | |
266 | | - | |
| 275 | + | |
267 | 276 | | |
268 | 277 | | |
269 | 278 | | |
| |||
356 | 365 | | |
357 | 366 | | |
358 | 367 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | 368 | | |
364 | 369 | | |
365 | 370 | | |
| |||
Lines changed: 16 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
110 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
0 commit comments