Skip to content

build: migrate to sbt 1.x and cross-publish for Scala 2.13 - #2

Merged
hongwei1 merged 1 commit into
OpenBankProject:masterfrom
hongwei1:build/sbt-1-and-scala-2.13
Aug 14, 2026
Merged

build: migrate to sbt 1.x and cross-publish for Scala 2.13#2
hongwei1 merged 1 commit into
OpenBankProject:masterfrom
hongwei1:build/sbt-1-and-scala-2.13

Conversation

@hongwei1

Copy link
Copy Markdown
Collaborator

Why

OBP-API consumes this repository through JitPack as com.github.OpenBankProject:scala-macros:v1.0.0-alpha.3 and is being migrated to Scala 2.13. That aggregate pom hardcodes 2.12 artifacts:

<artifactId>core_2.12</artifactId>
<artifactId>macros_2.12</artifactId>
<artifactId>scala-macros_2.12</artifactId>

An already-published pom cannot change, so a 2.13 build has to come from a new tag. Two things block that today: the build definition is sbt 0.13 syntax pinned to a single Scala version, and JitPack's default sbt command publishes only the default Scala version.

What

  • project/build.properties: sbt 0.13.11 -> 1.10.11.
  • build.sbt: drop the 0.13-only run <<= run in Compile in core root-run delegation, move scalaVersion in ThisBuild to sbt 1.x slash syntax, and cross-build 2.12.21 + 2.13.18 (the versions OBP-API compiles with).
  • project/plugins.sbt, project/assembly.sbt: removed. scalajs, sonatype, pgp, release and assembly are sbt 0.13-era plugins that no setting in this build references, and they block the sbt 1.x upgrade.
  • jitpack.yml: override JitPack's clean publishM2 with +publishM2 so a single tag publishes both the _2.12 and the _2.13 artifacts.

No source file changed. The macro is a blackbox def macro rather than a macro annotation, so it does not need the paradise plugin, and the reflection API it uses (c.internal.enclosingOwner, paramLists, c.freshName, quasiquotes) is unchanged in 2.13.

Verification

sbt +clean +compile +publishM2 on JDK 25, zero [error] lines, both versions compiled and published:

Scala macros core Published
2.12.21 4 sources 2 sources scala-macros_2.12, macros_2.12, core_2.12
2.13.18 4 sources 2 sources scala-macros_2.13, macros_2.13, core_2.13

After a tag is cut, the published artifacts must be verified by fetching pom and jar directly rather than trusting JitPack's maven-metadata.xml, which lists versions that do not exist.

The build definition was still sbt 0.13.11 syntax (`run <<= run in Compile in
core`), pinned to Scala 2.12.4, with no crossScalaVersions. OBP-API consumes
this repository through JitPack and is moving to Scala 2.13, which needs a
matching artifact.

- project/build.properties: sbt 0.13.11 -> 1.10.11.
- build.sbt: drop the 0.13-only `<<=` root-run delegation, replace
  `scalaVersion in ThisBuild` with the sbt 1.x slash syntax, and cross-build
  2.12.21 + 2.13.18 (the versions OBP-API compiles with).
- project/plugins.sbt, project/assembly.sbt: remove. scalajs, sonatype, pgp,
  release and assembly are all sbt 0.13-era plugins that no setting in this
  build ever referenced, and they block the sbt 1.x upgrade.
- jitpack.yml: JitPack's default sbt command is `clean publishM2`, which
  publishes only the default Scala version. Override it with `+publishM2` so a
  single tag yields both the _2.12 and the _2.13 artifacts.

The macro implementation needed no changes: it is a blackbox def macro, not a
macro annotation, so it does not depend on the paradise plugin, and the
reflection API it uses is unchanged in 2.13.
@hongwei1
hongwei1 merged commit f76154a into OpenBankProject:master Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant