Let’s say for jobtype 3 we’d like to use JDK 8, and for jobtype 1 and 2 we’d like to test on JDK 17. sbt-ci-release uses jabba to grab the JDKs, and at the moment the openjdk 17.0 distros are not available on jabba yet. However, Eclipse Adoptium fka AdoptOpenJDK does have the binary available, so we can use the custom JDK mode to use it as follows:
Macro is a fun and powerful tool, but overuse of the macro could cause harm as well. Please enjoy macros responsibly.
What is macro? A common explanation given is that a macro is a program that is able to take code as an input and output code. While it’s true, it might not immediately make sense since Scala programmers are often familiar with higher-order functions like (map {...}) and by-name parameter, which on the surface it might seem like it is passing a block of code around.
Jar Jar Abrams 1.8.0 and sbt-assembly 1.1.0 are released.
Jar Jar Abrams is an experimental extension to Jar Jar Links, intended to shade Scala libraries. Thus far we have been using Pants team’s fork of Jar Jar Links, but now that it’s been abandaned, Eric Peters has in-sourced it to jarjar-abrams repo so we can patch it.
Our jarjar fork is released under com.eed3si9n.jarjar organization name and package name.
bug fixes
Eric has fixed a bug around ShadeRules.keep.
enhancement
ASM was updated to 9.2.
sbt-assembly 1.1.0 upgrades the Jar Jar Abrams dependency to 1.8.0.
I’m hacking on a small project called sudori, an experimental sbt. The initial goal is to port the macro to Scala 3. It’s an exercise to take the macro apart and see if we can build it from the ground up. This an advanced area of Scala 2 and 3, and I’m finding my way around by trial and error. This is part 2.
When we think of the build.sbt macro, the first thing that comes to our mind is the Applicative do macro that it implements using .value even though some may not use those terms exactly. The main driver for this imperative-to-functional is in the companion object for an oddly named Instance class:
I’m hacking on a small project called sudori, an experimental sbt. The initial goal is to port the macro to Scala 3. It’s an exercise to take the macro apart and see if we can build it from the ground up. This an advanced area of Scala 2 and 3, and I’m finding my way around by trial and error.
In June of 2011, I started working on sbt-assembly for sbt 0.10, based on Coda Hale’s assembly-sbt from sbt 0.7, which in turn was probably inspired by maven-assembly-plugin. After ten years, I’m going to call this one 1.0.0. sbt-assembly 1.0.0 is published to Maven Central.
I’m picking up Python and its Bazel dialect Skylark lately. On the other hand, I’m familiar with Scala and its sbt dialect. Often I know exactly what I want to express, and I am fairly certain Python has the equivalent concept as Scala, but just don’t remember the exact incantation. For people starting Scala, maybe they could use this table in reverse.
There’s a long-standing bug that sbt maintainers have known for a while, which is that when sbt plugin is published to a Maven repository, the POM file sbt generates is not valid. From a mailing list thread titled [0.12] plan for instance, Mark McBride reported it in 2012:
On the maven note, the poms generated for plugins aren’t actually
valid. Trying to upload them to artifactory without disabling pom
consistency checks fails :/
I’m happy to announce sbt 1.5.1 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.5.1. This post will also report the Bintray to JFrog Artifactory migration.
Bintray to JFrog Artifactory migration status
First and foremost, I would like to thank JFrog for their continued support of sbt project and the Scala ecosystem.
As sbt was taking off in the number of contributors and plugins, we had a Bintray-shaped problem. We wanted individuals to create Ivy-layout repository, publish sbt plugins, but somehow aggregate the resolution to them. Having Github sbt organization allowed fluid ownership of plugin sources, but distributing the binary files were challenge as sbt version was churning. We adopted Bintray in 2014 and it provided the distribution mechanism during our growth years. In addition, we used Bintray to host Debian and RPM installers for sbt, paid for by Lightbend.
Wrote herding cats: day 19 featuring FunctionK, or Rúnar’s encoding of rank-2 polymorphic function, and Resource datatype, which he envisioned rank-N polymorphism would unlock back in 2010.
Hi everyone. On behalf of the sbt project, I am happy to announce sbt 1.5.0. This is the fifth feature release of sbt 1.x, a binary compatible release focusing on new features. sbt 1.x is released under Semantic Versioning, and the plugins are expected to work throughout the 1.x series.
Hi everyone. On behalf of the sbt project, I am happy to announce sbt 1.5.0-RC2. This is the fifth feature release of sbt 1.x, a binary compatible release focusing on new features. sbt 1.x is released under Semantic Versioning, and the plugins are expected to work throughout the 1.x series.
If no serious issues are found by Saturday, April 3rd 2021, 1.5.0-RC2 will become 1.5.0 final.
If no serious issues are found by Saturday, March 27th 2021, 1.5.0-RC1 will become 1.5.0 final.
In addition, the sbt version used for your build is upgraded by putting the following in project/build.properties:
sbt.version=1.4.9
This mechanism allows that sbt 1.4.9 is used only for the builds that you want.
Highlights
sbt 1.4.9 fixes JLine 2 fork + JAnsi version to match that of JLine 3.19.0 to fix line reading, which among other things affected IntelliJ import.
sbt 1.4.9 is a maintenance patch. The most notable thing is that this was that it was released without using Bintray, and a few things were dropped. See below for details.
Changes with compatibility implications
sbt 1.4.9 is published to Sonatype OSS without going through Bintray.
In addition, the sbt version used for your build is upgraded by putting the following in project/build.properties:
sbt.version=1.4.8
This mechanism allows that sbt 1.4.8 is used only for the builds that you want.
Highlights
sbt 1.4.8 is a maintenance patch. The most notable thing is that this was the first release that was released without using Bintray, and a few things were dropped. See below for details.
Changes with compatibility implications
sbt 1.4.8 is published to Sonatype OSS without going through Bintray.
This is because “unified” slash syntax is called so because it unifies the shell syntax and the build syntax together. Thus, it makes sense to deprecate the old build.sbt syntax that uses in like skip in publish or scalacOptions in (Compile, console), if we’re deprecating the old shell syntax.
git bisecting is a useful technique to locate the source of a bug. For scala/scala in particular, bisect.sh can save a lot of time by using the pre-build compiler artifacts on the Scala CI Artifactory.
I want to tell sbt “this specific version breaks binary compatibility, so don’t resolve it via eviction, fail the build instead.” How do I do this? Complete answers only, I’m done trying to figure it out by following clues.
In this post, we’ll try to automate the release of an sbt plugin using Ólaf’s olafurpg/sbt-ci-release. The README of sbt-ci-release covers the use case for a library published to Sonatype OSS. Read it thoroughly since this post will skip over the details that do not change for publishing sbt plugins.
Automated release in general is a best practice, but there’s one benefit specifically for sbt plugin releases. Using this setup allows multiple people to share the authorization to release an sbt plugin without adding them to Bintray sbt organization. This is useful for plugins maintained at work.
scopt 4.0.0 is cross published for the following build matrix:
Scala
JVM
JS (1.x)
JS (0.6.x)
Native (0.4.0-M2)
Native (0.3.x)
3.0.0-M2
✅
✅
n/a
n/a
n/a
3.0.0-M1
✅
✅
n/a
n/a
n/a
2.13.x
✅
✅
✅
n/a
n/a
2.12.x
✅
✅
✅
n/a
n/a
2.11.x
✅
✅
✅
✅
✅
scopt is a little command line options parsing library. scopt started its life in 2008 as aaronharnly/scala-options based loosely on Ruby’s OptionParser. scopt 2 added immutable parsing, and scopt 3 cleaned up the number of methods by introducing Read typeclass.