sbt

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

parallel cross building using sbt-projectmatrix

in

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"))
  .settings(
    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

in

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

in

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

in

Wrote sbt 1.2.0 on Lightbend Tech Hub blog.

hot source dependencies using sbt-sriracha

in

Source dependencies is one of features that existed in sbt since ever, but hasn't been documented well.

Using sbt-sriracha, we can define a hybrid dependency to µTest as follows:

lazy val utestJVMRef = ProjectRef(uri("git://github.com/eed3si9n/utest.git#5b19f47c"), "utestJVM")
lazy val utestJVMLib = "com.lihaoyi" %% "utest" % "0.6.4"
 
lazy val root = (project in file("."))
  .sourceDependency(utestJVMRef, utestJVMLib)
  .settings(
    name := "Hello world",
    testFrameworks += new TestFramework("utest.runner.Framework"),
  )

Now using these changes I can run custom µTest on Scala 2.13.0-M4.

cross JVM testing using Travis CI

in

Oracle is moving to ship non-LTS JDK every 6 months, and LTS JDK every 3 years. Also it's converging to OpenJDK. In this scheme, JDK 9 will be EOL in March 2018; JDK 10 will come out in March 2018, and EOL in September 2018; and LTS JDK 11 that replaces JDK 8 in September 2018 will stay with us until 2021.

As we will see quick succession of JDKs in the upcoming months, here's a how-to on testing your app on JDK 8, JDK 9, and JDK 10 Early Access using Travis CI.

dist: trusty
 
language: scala
 
matrix:
  include:

removing commas with sbt-nocomma

in

This post introduces sbt-nocomma that introduces nocomma { ... } macro that removes commas from build.sbt:

import Dependencies._
 
lazy val root = (project in file("."))
  .settings(nocomma {
    ThisBuild / organization := "com.example"
    ThisBuild / scalaVersion := "2.12.4"
    ThisBuild / version      := "0.1.0-SNAPSHOT"
 
    name := "Hello"
 
    // comment works
    libraryDependencies += scalaTest % Test
  })

sbt-sticker

in

As tweeted, I made some sbt stickers.

I made these for myself, but I've been sharing them with the contributors to the sbt ecosystem.

If you've ever reported a bug, answered Stackoverflow question, helped someone else's build problem, created an sbt plugin, given a talk about sbt, or sent in a pull request, please come say hello at ScalaMatsuri or Scala Days.

sbt server with Neovim

in

This is part 3 of sbt server integration series. I've covered VS Code and Sublime Text 3 thus far.

vim-scala-sbt

sbt server with Sublime Text 3

in

On Tech Hub blog I demonstrated how to use sbt server from VS Code to display compiler errors from a running sbt session. In this post, I'll show how to do that for Sublime Text 3.

sublime-sbt-scala

Syndicate content