Skip to content

chore: Migrate the main build to sbt 2.x#628

Merged
xerial merged 1 commit into
mainfrom
chore/sbt2-migration
Jun 30, 2026
Merged

chore: Migrate the main build to sbt 2.x#628
xerial merged 1 commit into
mainfrom
chore/sbt2-migration

Conversation

@xerial

@xerial xerial commented Jun 30, 2026

Copy link
Copy Markdown
Member

Why

The main build ran on sbt 1.x. The blockers are now gone:

What

  • project/build.propertiessbt 2.0.1; metabuild plugins swapped (see table in the ADR). Dropped unused sbt-buildinfo and the now-built-in addDependencyTreePlugin; bumped sbt-pack 0.23 → 1.0.0.
  • Because sbt-uni-crossproject reproduces the crossProject / CrossType.Pure API, the project definitions are unchanged. Only sbt-2.x source adjustments:
    • root → uni-root — sbt 2.x derives output dirs from the project name, which collided with the uni library project ("Overlapping output directories").
    • %%%%% everywhere; the platform-less scalajs-test-interface_2.13 named directly with a single % (in a JS project, any cross-version injects the unwanted _sjs1).
    • Test / jsEnv wrapped in Def.uncached(...) (JSEnv isn't serializable; sbt 2.x caches settings).
    • import scala.language.implicitConversions for core.jvm used as ProjectReference; xs: _*xs*; infix classifier.classifier(...).
  • Docs: CLAUDE.md + the book's cross-build install snippet updated to the sbt 2.x / sbt-uni-crossproject approach. New ADR adr/2026-06-30-sbt2-main-build-migration.md.
  • CI needs no change — the repo's ./sbt runner reads build.properties (→ 2.0.1) and code_format uses the kept sbt-scalafmt.

Validation (all on sbt 2.0.1, run locally)

Platform Result
JVM (projectJVM/test) 1655 passed, 4 pending · +39 netty/book
JS / NodeJSEnv uniJS ~1420 · testJS 71 passed
JS / Playwright Chromium (domTest) 374 passed
Native (projectNative/test) uniNative 1417 (+9 pending) · testNative 71 passed

scalafmtCheckAll and pnpm docs:build pass. (uni-core reports 0 tests on every platform — it has no src/test, not a regression.)

🤖 Generated with Claude Code

The blockers are gone: sbt-crossproject and the third-party Playwright env are
replaced by uni-owned sbt 2.x plugins, and sbt-revolver (unused, no sbt 2.x
build) by sbt-uni's uniRestart/uniStop/uniStatus. Flip project/build.properties
to sbt 2.0.1 and swap the metabuild plugins accordingly.

Because sbt-uni-crossproject reproduces the crossProject / CrossType.Pure API,
the project definitions are unchanged; only sbt-2.x source adjustments were
needed: rename root to uni-root (sbt 2.x derives output dirs from the project
name, which collided with the uni library), %%% -> %%, name the platform-less
scalajs-test-interface_2.13 with a single %, wrap Test/jsEnv in Def.uncached,
add the implicitConversions import, and fix xs: _* / infix classifier.

All three platforms compile and test on sbt 2.0.1: JVM (1655+39), JS via
NodeJSEnv (~1491) and domTest via Playwright/Chromium (374), Native (1417+71).
See adr/2026-06-30-sbt2-main-build-migration.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the internal Non-user facing changes label Jun 30, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the main build from sbt 1.x to sbt 2.0.1. It replaces unported third-party plugins with custom, uni-owned sbt 2.x plugins (such as sbt-uni-crossproject, uni-jsenv-playwright, and sbt-uni), updates dependency syntax (switching from %%% to %% and wrapping non-serializable jsEnv instances in Def.uncached), and renames the root project to uni-root to prevent output directory collisions. Relevant documentation and an ADR have also been added or updated. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@xerial xerial merged commit c7e5cd1 into main Jun 30, 2026
15 checks passed
@xerial xerial deleted the chore/sbt2-migration branch June 30, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Non-user facing changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant