Update your Scala dependencies (both libraries and plugins) interactively. Video Demo.
brew install kitlangton/tap/scala-update
If you'd like slightly faster binaries on an M1 mac, install manually with GraalVM (the next step).
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
- 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
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.
If multiple dependencies share a single version, they will be grouped.
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.
I have another library, zio-tui, for creating interactive command line programs just like this one.