Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kitlangton/scala-update

Update your Scala dependencies interactively
https://github.com/kitlangton/scala-update

Last synced: 10 days ago
JSON representation

Update your Scala dependencies interactively

Awesome Lists containing this project

README

        

# scala-update
[![Release Artifacts][Badge-SonatypeReleases]][Link-SonatypeReleases]

Update your Scala dependencies (both libraries and plugins) interactively. [Video Demo](https://twitter.com/kitlangton/status/1541417514823028740).

## Installation

### Homebrew (Mac Only)

```shell
brew install kitlangton/tap/scala-update
```

*If you'd like slightly faster binaries on an M1 mac, install manually with GraalVM (the next step).*

### Manually with GraalVM

#### Prerequisites

You need GraalVM installed. If you don't have it, you may check their docs [here](https://www.graalvm.org/java/quickstart/). If you're using SDKMAN!, GraalVM images are available to install easily [here](https://sdkman.io/jdks#grl).
```shell
# See Java versions and pick a GraalVM version, for example 22.1.0.r17-grl
sdk list java

sdk install java 22.1.0.r17-grl

# If you haven't set grl version as default, set it for the current terminal session
sdk use java 22.1.0.r17-grl
```

You need `native-image` installed. You can install it with GraalVM updater.
```shell
gu install native-image
```

#### Building Native Image with GraalVM

1. Build the native image with `show graalvm-native-image:packageBin`.

```shell
sbt 'show graalvm-native-image:packageBin'
# [info] ~/code/sbt-interactive-update/target/graalvm-native-image/scala-update
```

2. Move the generated binary onto your `PATH`. For example (in project root directory)
```shell
# Might need to run with sudo
cp target/graalvm-native-image/scala-update /usr/local/bin
```

## Usage

Run the command from within an sbt project folder.

```shell
scala-update
```

CleanShot 2022-06-27 at 09 15 23@2x

The commands are displayed at the bottom of the interactive output.

Select the libraries you wish to update, then hit `Enter` to update your build files to the selected versions.

CleanShot 2022-06-27 at 09 15 53@2x

### Grouped Depenendcies

If multiple dependencies share a single version, they will be grouped.

CleanShot 2022-06-27 at 09 18 15@2x

### Multiple Versions

If a dependency has multiple possible update version—for instance, a new major version and a new minor version—then you can select which version to upgrade to.

CleanShot 2022-06-27 at 09 20 23@2x

## FAQ

### How did you make the interactive CLI?

I have another library, [zio-tui](https://github.com/kitlangton/zio-tui), for creating interactive command line programs just like this one.

[Badge-SonatypeReleases]: https://img.shields.io/nexus/r/https/oss.sonatype.org/io.github.kitlangton/scala-update_2.13.svg "Sonatype Releases"
[Badge-SonatypeSnapshots]: https://img.shields.io/nexus/s/https/oss.sonatype.org/io.github.kitlangton/scala-update_2.13.svg "Sonatype Snapshots"
[Link-SonatypeSnapshots]: https://oss.sonatype.org/content/repositories/snapshots/io/github/kitlangton/scala-update_2.13/ "Sonatype Snapshots"
[Link-SonatypeReleases]: https://oss.sonatype.org/content/repositories/releases/io/github/kitlangton/scala-update_2.13/ "Sonatype Releases"