Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Working in this repository

Building and testing: the README's "Building and testing locally" section. This is the 17 line: Gradle, the toolchain
and the tests run on the Temurin 17 that `mise install` provides, and `./gradlew check` is what CI runs. Until 17.1.0
is out nothing in the build formats the code: format the files you changed with the 21 line's runnable jar on JDK 21,
`java -jar open-java-format-21.1.2-all.jar --replace <files>`. Error Prone, NullAway and Checkstyle do not run here;
the code is checked on 21.X.X and comes here as backports.
and the tests run on the Temurin 17 that `mise install` provides, `./gradlew check` is what CI runs, and
`./gradlew formatDiff` formats the files you changed with the released 17.1.0. Error Prone, NullAway and Checkstyle do
not run here; the code is checked on 21.X.X and comes here as backports.

## Conventions for new code

Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,8 @@ Nothing inside the build downloads a JDK. `gradle.properties` turns toolchain au
reads the installation from `JDK17_HOME`, so a missing JDK is an error you can read rather than a
silent download.

The released Gradle plugin that formats this repository is built for Java 21, so the 17 line applies
none until 17.1.0 is out. Until then, format the files you change with the 21 line's runnable jar on
JDK 21:

```bash
java -jar open-java-format-21.1.2-all.jar --replace <files>
```
`./gradlew formatDiff` formats the files you changed with the released 17.1.0, the 17 line's own: the
21 line's Gradle plugin does not load on Gradle with JDK 17.

The native image, the IntelliJ and Eclipse plugins, the WebAssembly module and the benchmarks are
built on the 21 line. Here they stay in the tree, commented out in `settings.gradle`, so that a
Expand Down
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ buildscript {

dependencies {
classpath 'com.gradle.publish:plugin-publish-plugin:2.2.1'
// The released open-java-format formats this repository, not the one being built here. The 21 line's
// plugin does not load on Gradle with JDK 17, so the 17 line applies none until 17.1.0 is out; until then,
// changes made on the branch are formatted with the 21 line's -all.jar.
// classpath 'dev.openjavaformat:gradle-open-java-format:21.0.2'
// The released open-java-format formats this repository, not the one being built here: the 17 line's own,
// since the 21 line's plugin does not load on Gradle with JDK 17.
classpath 'dev.openjavaformat:gradle-open-java-format:17.1.0'
classpath 'me.champeau.jmh:jmh-gradle-plugin:0.7.4'
}
}
Expand Down Expand Up @@ -49,7 +48,7 @@ def javacInternalExports = [
]

allprojects {
// apply plugin: 'dev.openjavaformat.java-format'
apply plugin: 'dev.openjavaformat.java-format'

// The fork's Maven group (README, "Coordinates"). The Java packages stay com.palantir.javaformat.
group = 'dev.openjavaformat'
Expand Down
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ org.gradle.jvmargs=--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAME
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED

# Read by the released dev.openjavaformat.java-format plugin that formats this repository, which the 17 line does
# not apply until 17.1.0 is out (build.gradle); the 17 line publishes no native image of its own.
# openjavaformat.native.formatter=true
# The released dev.openjavaformat.java-format plugin that formats this repository (build.gradle) runs the formatter
# inside the Gradle JVM, with the exports above: the 17 line publishes no native image of its own.

# Where Gradle looks for JDKs: the 17 line needs JDK 17 alone. Locally JDK17_HOME is unset and mise's install is
# found through Gradle's asdf provider instead.
Expand Down
Loading