ZIO SBT contains multiple sbt plugins that are useful for ZIO projects. It provides high-level SBT utilities that simplify the development of ZIO applications.
ZIO SBT is made of five modules, three of which are sbt plugins that a ZIO project enables in its build:
- ZIO SBT Ecosystem (
zio-sbt-ecosystem) holds the standard settings, compiler options and commands (fmt,lint,prepare) that every ZIO project shares. - ZIO SBT Website (
zio-sbt-website) compiles the documentation indocs/with mdoc, builds and previews the Docusaurus website, publishes the docs to npm, and generates theREADME.md. - ZIO SBT CI (
zio-sbt-ci) generates the GitHub Actions workflows of a project from itsbuild.sbt. - ZIO SBT GitHub Actions (
zio-sbt-githubactions) is the model of GitHub workflows (Workflow,Job,Step, ...) that ZIO SBT CI is built on. It comes withzio-sbt-ci, so it needs no installation of its own. - ZIO SBT Source (
zio-sbt-source) is a library, not an sbt plugin, that embeds source files and evaluated expressions into the documentation.
Add the following lines to your project/plugins.sbt file:
// Standard settings, compiler options and the fmt, lint and prepare commands
addSbtPlugin("dev.zio" % "zio-sbt-ecosystem" % "0.8.9")
// Generates the GitHub Actions workflows from build.sbt
addSbtPlugin("dev.zio" % "zio-sbt-ci" % "0.8.9")
// Builds, previews and publishes the documentation website
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.8.9")Then you can enable them by using the following code in your build.sbt file:
enablePlugins(
WebsitePlugin,
ZioSbtEcosystemPlugin,
ZioSbtCiPlugin
):::note
Always try to keep the SBT version specified in the project/build.properties file up to date to ensure compatibility with the ZIO SBT plugins.
:::
To embed source files into the documentation, also add zio-sbt-source, which is a regular library dependency and belongs in the build.sbt of the docs project:
libraryDependencies += "dev.zio" %% "zio-sbt-source" % "0.8.9"Read Getting Started to set up a project, the Reference for every setting, task and command, and the How-to Guides for common CI tasks.
Learn more on the ZIO SBT homepage!
For the general guidelines, see ZIO contributor's guide.
Before you submit a PR, make sure your tests are passing, and that the code is properly formatted
sbt prepare
sbt +test
See the Code of Conduct