From d268b6f46047b499e6d5b3cdc2407759131f1d65 Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Sat, 28 Nov 2026 20:22:32 +0300 Subject: [PATCH] Write the release notes for 21.1.2 --- release-notes/21.1.2.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 release-notes/21.1.2.md diff --git a/release-notes/21.1.2.md b/release-notes/21.1.2.md new file mode 100644 index 000000000..d430d03f8 --- /dev/null +++ b/release-notes/21.1.2.md @@ -0,0 +1,18 @@ +The formatter's output is the same as 21.1.1's, so this release needs no reformatting run. The Gradle plugin now formats Android modules, and the command line tool installs with Homebrew, Scoop, apt and mise. + +## Gradle plugin + +- `formatDiff` and the Spotless step now format the Java files of Android modules: those with `com.android.application`, `com.android.library`, `com.android.dynamic-feature` or `com.android.test`, from Android Gradle plugin 9.1 on. Up to 21.1.1 the plugin did nothing in a module without the `java` plugin: there was no `formatDiff`, and `spotlessCheck` passed whatever the files held. Both cover the `java` directories of every Android source set, and Java files in the `kotlin` directories are left out. The plugin reads the source sets from the build's own Android Gradle plugin and brings none of its own ([#284](https://github.com/openjavaformat/open-java-format/issues/284), [#288](https://github.com/openjavaformat/open-java-format/pull/288)). + +## Command line + +- Homebrew on macOS and Linux, Scoop on Windows and apt on Ubuntu and Debian install the native binary and take each new release within the hour; mise installs it on macOS, Linux and Windows and pins its version per project. The commands are on the [Command line](https://openjavaformat.dev/get-started/command-line/) page ([#151](https://github.com/openjavaformat/open-java-format/issues/151), [#152](https://github.com/openjavaformat/open-java-format/issues/152), [#153](https://github.com/openjavaformat/open-java-format/issues/153), [#260](https://github.com/openjavaformat/open-java-format/issues/260)). +- The release carries the Linux binaries as .deb packages too, `open-java-format_21.1.2_amd64.deb` and `open-java-format_21.1.2_arm64.deb`, signed and in `checksums_sha256.txt` like every other file. They install `/usr/bin/open-java-format` and need glibc 2.34 or later: Ubuntu 22.04, Debian 12 or newer ([#289](https://github.com/openjavaformat/open-java-format/pull/289)). + +## Formatter + +- Reading a comment no longer goes through reflection into javac. For every comment of every file the formatter looked up a field that javac has not had since JDK 15, caught the exception, and then copied the comment's text only to take its length ([#286](https://github.com/openjavaformat/open-java-format/issues/286), [#287](https://github.com/openjavaformat/open-java-format/pull/287)). + +## Thanks + +To Liam Miller-Cushon of google-java-format, whose change to reading comments, [google-java-format#1546](https://github.com/google/google-java-format/pull/1546), is ported here.