scala-update
Update your Scala dependencies (both libraries and plugins) interactively. Video Demo.
Installation
Homebrew (Mac Only)
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. If you're using SDKMAN!, GraalVM images are available to install easily here.
# 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.
gu install native-image
Building Native Image with GraalVM
- Build the native image with
show graalvm-native-image:packageBin
.
sbt 'show graalvm-native-image:packageBin'
# [info] ~/code/sbt-interactive-update/target/graalvm-native-image/scala-update
- Move the generated binary onto your
PATH
. For example (in project root directory)
# 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.
scala-update
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.
Grouped Depenendcies
If multiple dependencies share a single version, they will be grouped.
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.
FAQ
How did you make the interactive CLI?
I have another library, zio-tui, for creating interactive command line programs just like this one.