Repository navigation
Commit d4a1480
committed
Fail spotlessJava when the Gradle JVM does not export javac
The formatter checks that javac's internals are exported to it when
it loads, and inside the Spotless step that failure became a lint of
every file: spotlessJava succeeded, the build cache kept the lint, and
spotlessApply failed on it until the cache was cleared, even after the
flags were added.
spotlessJava now runs the same check before the step does, as an
action of its own, without loading the formatter: the flags export the
packages to every unnamed module, so the plugin's module answers for
the formatter's. spotlessJava fails with the message formatDiff gives,
nothing is stored in the build cache, and once the flags are there
the next build formats. A file the formatter cannot parse is still a
lint of that file.1 parent c04a321 commit d4a1480
2 files changed
Lines changed: 23 additions & 0 deletions
File tree
- gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
55 | 70 | | |
0 commit comments