diff --git a/docs/about.md b/docs/about.md index cbf47ed..04d9c48 100644 --- a/docs/about.md +++ b/docs/about.md @@ -15,14 +15,15 @@ project exists is in the [manifesto](manifesto.md). | [GitHub Releases](https://github.com/openjavaformat/open-java-format/releases/latest) | native binaries, the runnable jar, the Gradle, IntelliJ IDEA and Eclipse plugins | | [Homebrew tap](https://github.com/openjavaformat/homebrew-tap) | `openjavaformat/tap/open-java-format`, the native binary for macOS and Linux | | [Scoop bucket](https://github.com/openjavaformat/scoop-bucket) | `openjavaformat/open-java-format`, the native binary for Windows | +| [apt repository](https://github.com/openjavaformat/apt) | `open-java-format` from `https://apt.openjavaformat.dev`, the native binary for Ubuntu and Debian | The Maven Central artifacts, the Gradle plugins and the files of a GitHub release are built by the [release workflow](https://github.com/openjavaformat/open-java-format/blob/main/.github/workflows/release.yml) from the tag of the version. The Maven plugin has a repository and a release workflow of its own, [openjavaformat/fmt-maven-plugin](https://github.com/openjavaformat/fmt-maven-plugin). The Homebrew -formula and the Scoop manifest install the native binaries of the GitHub release. A workflow in the -tap and one in the bucket move them to each new release within the hour, once they have installed -and tested that release on every platform. +formula, the Scoop manifest and the apt packages install the native binaries of the GitHub release. +A workflow in the tap, one in the bucket and one in the apt repository move them to each new release +within the hour, once they have installed and tested that release on every platform. ## Versions diff --git a/docs/get-started/command-line.md b/docs/get-started/command-line.md index db84885..456a11b 100644 --- a/docs/get-started/command-line.md +++ b/docs/get-started/command-line.md @@ -1,8 +1,9 @@ # Command line The formatter comes as a native binary that needs no Java, and as a runnable jar for every platform -the binaries do not cover. Homebrew on macOS and Linux and Scoop on Windows install the binary and -keep it current; mise installs it on all three and pins its version per project. +the binaries do not cover. Homebrew on macOS and Linux, apt on Ubuntu and Debian and Scoop on +Windows install the binary and keep it current; mise installs it on all three and pins its version +per project. ## Homebrew @@ -21,6 +22,27 @@ file with `curl`, so macOS does not quarantine it. version can change the output (see [Versions](../about.md#versions)): `brew pin open-java-format` holds the installed one. +## apt + +``` sh +sudo install -d -m 0755 /etc/apt/keyrings +curl -fsSL https://apt.openjavaformat.dev/key.asc | sudo tee /etc/apt/keyrings/open-java-format.asc > /dev/null +echo "deb [signed-by=/etc/apt/keyrings/open-java-format.asc] https://apt.openjavaformat.dev stable main" \ + | sudo tee /etc/apt/sources.list.d/open-java-format.list +sudo apt update +sudo apt install open-java-format +``` + +The lines add our apt repository, [openjavaformat/apt](https://github.com/openjavaformat/apt), with +the key that signs it, and install the native binary of the latest release as +`/usr/bin/open-java-format`. The package is there for amd64 and arm64 and needs glibc 2.34 or later: +Ubuntu 22.04 or Debian 12 and newer. + +`sudo apt upgrade` takes each new release, at the latest an hour after it is published. A new minor +version can change the output (see [Versions](../about.md#versions)): +`sudo apt-mark hold open-java-format` holds the installed one. The repository carries the latest +version only; older versions are binaries to download, as below. + ## Scoop ``` powershell diff --git a/docs/index.md b/docs/index.md index 6162e93..b706122 100644 --- a/docs/index.md +++ b/docs/index.md @@ -156,7 +156,8 @@ on the [Maven plugin](get-started/maven.md) page. Every [release](https://github.com/openjavaformat/open-java-format/releases/latest) carries native binaries for Linux, macOS and Windows, and a runnable jar for Java 21 or later. Homebrew installs -the binary on macOS and Linux, and Scoop on Windows. +the binary on macOS and Linux, [apt](get-started/command-line.md#apt) on Ubuntu and Debian, and +Scoop on Windows. ``` sh title="Install with Homebrew" brew install openjavaformat/tap/open-java-format