sbt
- Docker
- docker-compose
v2
or higher (Note for macOS: enableUse Docker Compose V2
in Docker Preferences) - OpenJDK 11 or above
-
Start MySQL in docker container
Note: flags and options mean:
- use detached mode
- wait for all containers to be healthy
- remove volumes on exit
docker compose up -Vd --wait mysql
-
Fill db by demo data
sbt dev "scalaZioExample/runMain org.organization.utils.DemoDb"
-
Run
sbt dev scalaZioExample/run
-
Run in live reload mode
sbt dev ~scalaZioExample/reStart
-
When done, remove docker containers, networks and volumes
docker compose down -v
-
Clean build artifacts and recompile (just in case)
sbt clean compile
-
Run tests
sbt test
-
Check for dependency updates (just in case)
sbt dependencyUpdates
Go to http://localhost:8080/docs
sbt scalafix
โ run linter, check all files, fail on warnings
There are several modes: dev
, ci
, release
. In dev
mode "fatal warnings" are disabled, so you will be able to see warnings, but they won't prevent code from compiling.
- You can change tpolecat plugin mode in sbt interactively, e.g:
sbt ci
orsbt dev
- You can prepend your commands with mode, e.g:
sbt ci test
orsbt dev test
- You can set mode via env variable, e.g:
SBT_TPOLECAT_DEV=true sbt compile
,SBT_TPOLECAT_CI=true sbt compile
, orSBT_TPOLECAT_RELEASE=true sbt compile
- Apply the
Zio2Upgrade
scalafix rule, as described in the migration guide - Update dependencies
- Bump versions on core zio dependencies (
zio
,zio-streams
,zio-test
) - Remove pins on dependencies which were pinned to prevent a transitive dependency on ZIO2
- For other ZIO libraries, check their respective docs for a way to correctly add a version with ZIO2 support.
Some require you to specify a different organization name or artefact ID:
"io.d11" % "zhttp_2.13"
->"dev.zio" %% "zio-http"
"com.softwaremill.sttp.tapir" %% "tapir-zio1-http-server"
->"com.softwaremill.sttp.tapir" %% "tapir-zio-http-server"
"io.github.scottweaver" %% "zio-testcontainers-mysql"
->"io.github.scottweaver" %% "zio-2-0-testcontainers-mysql"
- Bump versions on core zio dependencies (
- Fix the remaining compilation errors referring to the migration guide.
- See PR with all the changes listed above