An sbt plugin to manage scalaz cross builds. Features include:
- Rewriting your project version based on community naming conventions.
- Adding scalaz version-specific directories to your source path.
- Add a
forScalazoperator to dependencies to try to find an appropriate one.
- Add to your
project/plugins.sbt:
addSbtPlugin("io.verizon.build" % "sbt-scalaz" % sbtScalazVersion)- Set
version in ThisBuildin your project'sversion.sbt:
version in ThisBuild := "1.0.0-SNAPSHOT"- Set
SCALAZ_VERSIONenvironment variable to initialize thescalazVersionsetting in your build. Travis users might include something like the following in.travis.yml:
env:
matrix:
- SCALAZ_VERSION=7.2.9
- SCALAZ_VERSION=7.1.11This plugin rewrites the version setting of your modules based on
version in ThisBuild and scalazVersion. No consensus has been
reached in the community, so this plugin supports multiple strategies.
You choose it by setting the scalazVersionRewriter:
importp verizon.build.ScalazPlugin.autoImport._
import verizon.build.ScalazPlugin.scalazVersionRewriters
scalazVersionRewriter := scalazVersionRewriters.scalazStream_0_8We recommend default, but scalazStream_0_8 also has significant
traction in the community:
| scalazVersionRewriter | version in ThisBuild | scalazVersion | version |
|---|---|---|---|
| default | 1.0.0 | 7.2.9 | 1.0.0-scalaz-7.2 |
| default | 1.0.0 | 7.1.11 | 1.0.0-scalaz-7.1 |
| default | 1.0.0-SNAPSHOT | 7.2.9 | 1.0.0-scalaz-7.2-SNAPSHOT |
| scalazStream_0_8 | 1.0.0 | 7.2.9 | 1.0.0a |
| scalazStream_0_8 | 1.0.0 | 7.1.11 | 1.0.0 |
| scalazStream_0_8 | 1.0.0-SNAPSHOT | 7.2.9 | 1.0.0a-SNAPSHOT |
sbt-scalaz tries to understand the Scalaz dependency ecosystem so
you don't have to. knobs, http4s, and specs2 use three
different publishing conventions. Use the forScalaz operator and
let sbt-scalaz find the right convention:
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-server" % "0.15.7" forScalaz scalazVersion.value,
"io.verizon.knobs" %% "core" % "4.0.30" forScalaz scalazVersion.value,
"org.specs2" %% "specs2-core" % "3.8.6" forScalaz scalazVersion.value
)under scalaz 7.2.9 becomes
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-server" % "0.15.7a",
"io.verizon.knobs" %% "core" % "4.0.30-scalaz-7.2",
"org.specs2" %% "specs2-core" % "3.8.6"
)and under scalaz 7.1.11 becomes
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-server" % "0.15.7",
"io.verizon.knobs" %% "core" % "4.0.30-scalaz-7.1",
"org.specs2" %% "specs2-core" % "3.8.6-scalaz-7.1"
)We do the dirty work so you don't have to.