sbt.star¶
Bump sbt, Scala, library dependencies and sbt plugins.
Edits are line-based, so comments and layout in build.sbt and the project/ directory stay as they were.
load("@fleet//sbt.star", "build_files", "set_sbt_version", "set_dependency", "set_val", "set_scala_version")
| Function | What it does |
|---|---|
build_files |
Lists the sbt build files. |
set_sbt_version |
Sets sbt.version in project/build.properties. |
set_dependency |
Sets the version of a library or sbt plugin wherever the build declares it. |
set_val |
Sets a string val, such as val catsVersion = "2.9.0", wherever it is defined. |
set_scala_version |
Sets scalaVersion, and matching entries of crossScalaVersions. |
build_files¶
Lists the sbt build files.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
Returns: The sorted paths of every *.sbt file, and every .scala and .sbt file under a project directory, outside target directories.
Example
Used in: sbt-scala-bump
set_sbt_version¶
Sets sbt.version in project/build.properties.
A newer version already there is kept, so a campaign never lowers one.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
version |
The sbt version, such as 1.10.2. |
Returns: True when the file changed.
Example
Used in: sbt-scala-bump
set_dependency¶
Sets the version of a library or sbt plugin wherever the build declares it.
A newer version already there is kept, so a campaign never lowers one.
Covers "org" % "name" % "v" and "org" %% "name" % "v" (with any
configuration such as % Test after it), and addSbtPlugin(...).
Versions held in a val are left alone; set the val with
set_val.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
organization |
The group, such as org.typelevel. |
name |
The artifact name, without a Scala suffix. |
version |
The new version. |
Returns: The list of paths that changed.
Example
set_val¶
Sets a string val, such as val catsVersion = "2.9.0", wherever it is defined.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
name |
The val's name. |
value |
The new string value. |
Returns: The list of paths that changed.
Example
set_scala_version¶
Sets scalaVersion, and matching entries of crossScalaVersions.
Arguments
| Name | Description |
|---|---|
repo |
The repo passed to change(repo). |
version |
The Scala version, such as 2.13.15. |
from_version |
When set, only this version is replaced, so a cross-built project keeps its other Scala versions. |
Returns: The list of paths that changed.
Example
Used in: sbt-scala-bump