chore: Migrate the main build to sbt 2.x#628
Conversation
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>
There was a problem hiding this comment.
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.
Why
The main build ran on sbt 1.x. The blockers are now gone:
sbt-scalajs-crossproject+sbt-scala-native-crossproject→sbt-uni-crossproject(feature: Add minimal sbt 2.x crossproject plugin (sbt-uni-crossproject) #623)scala-js-env-playwright→uni-jsenv-playwright(feature: Add uni-owned Playwright Scala.js JSEnv + sbt 2.x plugin #613)sbt-revolver(unused in the build, no sbt 2.x release) →sbt-uni'suniRestart/uniStop/uniStatusWhat
project/build.properties→ sbt 2.0.1; metabuild plugins swapped (see table in the ADR). Dropped unusedsbt-buildinfoand the now-built-inaddDependencyTreePlugin; bumpedsbt-pack0.23 → 1.0.0.sbt-uni-crossprojectreproduces thecrossProject/CrossType.PureAPI, the project definitions are unchanged. Only sbt-2.x source adjustments:uni-root— sbt 2.x derives output dirs from the project name, which collided with theunilibrary project ("Overlapping output directories").%%%→%%everywhere; the platform-lessscalajs-test-interface_2.13named directly with a single%(in a JS project, any cross-version injects the unwanted_sjs1).Test / jsEnvwrapped inDef.uncached(...)(JSEnv isn't serializable; sbt 2.x caches settings).import scala.language.implicitConversionsforcore.jvmused asProjectReference;xs: _*→xs*; infixclassifier→.classifier(...).sbt-uni-crossprojectapproach. New ADRadr/2026-06-30-sbt2-main-build-migration.md../sbtrunner readsbuild.properties(→ 2.0.1) andcode_formatuses the keptsbt-scalafmt.Validation (all on sbt 2.0.1, run locally)
projectJVM/test)domTest)projectNative/test)scalafmtCheckAllandpnpm docs:buildpass. (uni-corereports 0 tests on every platform — it has nosrc/test, not a regression.)🤖 Generated with Claude Code