Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: retire Homebrew, point to coursier #1960

Merged
merged 6 commits into from
May 9, 2020
Merged
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
57 changes: 36 additions & 21 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,28 +207,41 @@ The recommended way to install the scalafmt command line tool is with
### Coursier

<div class="sidenote">
To install Coursier see <a href="https://get-coursier.io/docs/cli-overview" target="_blank">here</a>
To install Coursier see
<a href="https://get-coursier.io/docs/cli-installation" target="_blank">here</a>
</div>

Create a standalone executable in `/usr/local/bin/scalafmt` with (sudo if
necessary):
#### install

If you're using a recent version of `coursier` which supports direct
[installation](https://get-coursier.io/docs/cli-overview.html#install)
of packages, the simplest approach is by running

```sh
coursier bootstrap org.scalameta:scalafmt-cli_2.12:@STABLE_VERSION@ \
-r sonatype:snapshots \
-o /usr/local/bin/scalafmt --standalone --main org.scalafmt.cli.Cli
cs install scalafmt
scalafmt --version # should be @STABLE_VERSION@
```

Alternatively you can create a slim 15 KiB bootstrap script with:
#### standalone

Alternatively, you can create a complete standalone executable with:

```sh
curl -Lo coursier https://git.io/coursier-cli
chmod +x coursier
./coursier bootstrap org.scalameta:scalafmt-cli_2.12:@STABLE_VERSION@ \
-r sonatype:snapshots \
-o scalafmt --main org.scalafmt.cli.Cli
rm -f coursier
coursier bootstrap org.scalameta:scalafmt-cli_2.13:@STABLE_VERSION@ \
-r sonatype:snapshots --main org.scalafmt.cli.Cli \
--standalone \
-o scalafmt
./scalafmt --version # should be @STABLE_VERSION@
```

#### slim

Finally, you can choose to obtain a slim 15 KiB bootstrap script instead with:

```sh
coursier bootstrap org.scalameta:scalafmt-cli_2.13:@STABLE_VERSION@ \
-r sonatype:snapshots --main org.scalafmt.cli.Cli \
-o scalafmt
./scalafmt --version # should be @STABLE_VERSION@
```

Expand Down Expand Up @@ -293,9 +306,9 @@ vim/Emacs/Atom/Sublime/VS Code.
necessary)

```sh
coursier bootstrap --standalone org.scalameta:scalafmt-cli_2.12:@STABLE_VERSION@ \
-r sonatype:snapshots \
-o /usr/local/bin/scalafmt_ng -f --main com.martiansoftware.nailgun.NGServer
coursier bootstrap --standalone org.scalameta:scalafmt-cli_2.13:@STABLE_VERSION@ \
-r sonatype:snapshots -f --main com.martiansoftware.nailgun.NGServer \
-o /usr/local/bin/scalafmt_ng
scalafmt_ng & // start nailgun in background
ng ng-alias scalafmt org.scalafmt.cli.Cli
ng scalafmt --version # should be @STABLE_VERSION@
Expand All @@ -309,16 +322,18 @@ once in awhile.

### Homebrew
kitbellew marked this conversation as resolved.
Show resolved Hide resolved

You can install scalafmt via Homebrew using a custom formula
The recommended way to install the scalafmt command line tool is with
[Coursier](#coursier), itself available via Homebrew.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to have copy-paste friendly instructions for Homebrew users

The recommended way to install the scalafmt command line tool is with
[Coursier](#coursier), itself available via Homebrew.

```sh
brew install coursier/formulas/coursier
coursier install scalafmt
scalafmt --help
```

If necessary, make sure to follow the Coursier instructions for updating
`$PATH` so that the `scalafmt` binary becomes available in your terminal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.


```sh
brew install --HEAD olafurpg/scalafmt/scalafmt
brew install coursier/formulas/coursier
coursier install scalafmt
scalafmt --version // should be @STABLE_VERSION@

// to upgrade between releases
brew upgrade scalafmt
```

If necessary, make sure to follow the Coursier instructions for updating
`$PATH` so that the `scalafmt` binary becomes available in your terminal.

### Arch Linux

You can install scalafmt for Arch Linux from AUR. There is the
Expand Down