warning: Creating default object from empty value in /opt/bitnami/apps/portal/htdocs/modules/taxonomy/ on line 33.

keeping promise in sbt


build.sbt is a DSL for defining a task graph to be used for automatic parallel processing. The message passing among the tasks are expressed using something.value macro, which encodes Applicative composition (task1, task2) mapN { case (t1, t2) => .... }.

One mechanism I've been thinking about is allowing some long-running task1 to communicate with task2 midway.


cached compilation for sbt


The notion of cached compilation or remote cache has been around for a while now, but often it required the setup has not been easy. If we can bake build-as-function feature into basic tool chain such as Zinc and sbt, Scala community in general can benefit from it to speed up the build.

Even for open source projects, if Travis CI publishes into Bintray or something, the contributors might be able to resume compilation off of the last build.

The PR for sbt change is sbt/sbt#5534, and the virtualization change in Zinc is sbt/zinc#712.

sbt 1.3.10


I'm happy to announce sbt 1.3.10 patch release. Full release note is here -

Normally changing the project/ to


would be ok. However, given that the release may contain fixes to scripts and also because your initial resolution would be faster with *.(zip|tgz|msi) that contains all the JAR files, we recommend you use the installer distribution. They will be available from SDKMAN etc.

Zinc 1.4.0-M1


I've just released Zinc 1.4.0-M1. Note this is a beta release and it won't be compatible with future 1.4.x, but I chose a commit fairly close to 1.3.x so it should be usable.

parallel cross building, part 3


sbt-projectmatrix 0.4.0 came pretty close, but there are some issue I ran into when I tried to use it in a real project. First is the lack of % syntax.

It's fairly common for subprojects to depend only from Test configuration, or depend on Compile from Compile, and Test from Test. 0.5.0 adds % to make this possible.

lazy val app = (projectMatrix in file("app"))
  .dependsOn(core % "compile->compile;test->test")
    name := "app"
  .jvmPlatform(scalaVersions = Seq("2.12.10"))
lazy val core = (projectMatrix in file("core"))
    name := "core"
  .jvmPlatform(scalaVersions = Seq("2.12.10", "2.13.1"))

Another feature that's available to Project is .configure(...) method. It takes a vararg of Project => Project functions, and applies them in order. Since some of the builds I deal with uses .configure(...) this helps me migrate from Project to ProjectMatrix.

sbt core concepts


I gave a talk at Scala Days 2019 at Lausanne in June.

parallel cross building using sbt-projectmatrix


Last year I wrote an experimental sbt plugin called sbt-projectmatrix to improve the cross building in sbt. I've just released 0.2.0.

building against multiple Scala versions

After adding sbt-projectmatrix to your build, here's how you can set up a matrix with two Scala versions.

ThisBuild / organization := "com.example"
ThisBuild / scalaVersion := "2.12.8"
ThisBuild / version      := "0.1.0-SNAPSHOT"
lazy val core = (projectMatrix in file("core"))
    name := "core"
  .jvmPlatform(scalaVersions = Seq("2.12.8", "2.11.12"))

This will create subprojects coreJVM2_11 and coreJVM2_12.
Unlike ++ style stateful cross building, these will build in parallel.

running sbt on Docker


For AdoptOpenJDK JDK 8:

docker pull eed3si9n/sbt:jdk8-alpine
docker run -it --mount src="$(pwd)",target=/opt/workspace,type=bind eed3si9n/sbt:jdk8-alpine

For AdoptOpenJDK JDK 11:

docker pull eed3si9n/sbt:jdk11-alpine
docker run -it --mount src="$(pwd)",target=/opt/workspace,type=bind eed3si9n/sbt:jdk11-alpine

super shell for sbt


I've implemented "super shell" feature for sbt over the weekend. The idea is to take over the bottom n lines of the termnial, and display the current tasks in progress.

super shell

sbt 1.2.0


Wrote sbt 1.2.0 on Lightbend Tech Hub blog.

Syndicate content