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.

splitting git repo

split a subdirectory into a new repo

git clone --no-hardlinks --branch master originalRepoURL childRepo
cd childRepo
git filter-branch --prune-empty --subdirectory-filter path/to/keep master
git remote remove origin
git prune
git gc --aggressive

Change originalRepoURL, master, and path/to/keep to appropriate values. Use -- --all to handle all branches.

move src back to path/to/keep

--subdirectory-filter moves the path of src/ etc under path/to/keep to root, so if you need to add a commit to move it back to the same (or another) path.

all your JDKs on Travis CI using SDKMAN!

in

This is a second post on installing your own JDKs on Travis CI. Previously I've written about jabba.

Today, let's look at SDKMAN!, an environment manager written by Marco Vermeulen (@marc0der) for JDKs and various tools on JVM, including Groovy, Spark, sbt, etc.

AdoptOpenJDK 11 and 8

2019.03 mixtape

in

Spotify: https://open.spotify.com/user/1235450353/playlist/0guisAxA5Q2WO6biLJqdU0...
YouTube: https://www.youtube.com/playlist?list=PLSUh6oJ5ZotUlIMwWcbtV7FRTEzHqYm_7

2h 58m

track list

  • Mbr / Ajisai - Ametsub
  • Win In The Flat World - Lorenzo Senni
  • Opal - Four Tet Remix - Bicep, Four Tet
  • ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ৢ؞ؖ؞ - △▃△▓
  • Recursion - Throwing Snow
  • Opal Waltz - Supernaive
  • Turnhalle - Barker & Baumecker
  • #17 - Aphex Twin
  • Good Winds - Efdemin
  • Stingray Nebula - OUER

'Ancillary Justice' by Ann Leckie

Ancillary Justice (Imperial Radch, #1)Ancillary Justice by Ann Leckie
My rating: 4 of 5 stars

'Ancillary Justice' is written in a first-person narrative as the AI of thousands of years old starship Justice of Toren of The Radchaai Empire. Another interesting part is since the Radchaai language is genderless, the narrator constantly describes everyone as "she," but later you might discover that some character might be he. There are other small details here and there that narrator might say, but you start to question it as the story develops. In other words, Ann Leckie has done a stylish job of show-and-not-tell about the world that she's built.

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

Pamflet 0.8.0

in

Over the holiday break I've implemented left TOC for Pamflet, and released it as Pamflet 0.8.0.

scopt 4

in

Here's how functional DSL looks like in scopt 4:

import scopt.OParser
val builder = OParser.builder[Config]
val parser1 = {
  import builder._
  OParser.sequence(
    programName("scopt"),
    head("scopt", "4.x"),
    // option -f, --foo
    opt[Int]('f', "foo")
      .action((x, c) => c.copy(foo = x))
      .text("foo is an integer property"),
    // more options here...
  )
}
 
// OParser.parse returns Option[Config]
OParser.parse(parser1, args, Config()) match {
  case Some(config) =>
    // do something
  case _ =>
    // arguments are bad, error message will have been displayed
}

Instead of calling methods on OptionParser, the functional DSL first creates a builder based on your specific Config datatype, and calls opt[A](...) functions that returns OParser[A, Config].

These OParser[A, Config] parsers can be composed using OParser.sequence(...).

holiday brussel sprouts salad

Syndicate content