portable-scala/sbt-crossproject
57.1
Adequate · 20 September 2026
804
lines of production code
Scala
primary language
1
measurement over time
What this system is
This system is an sbt plugin ecosystem that enables cross-compilation of Scala projects across JVM, JavaScript, and Native platforms. It provides a unified API for defining shared and platform-specific source directories, managing dependencies, and handling resource packaging. The system includes specialized sub-plugins for Scala.js and Scala Native to integrate seamlessly with the core cross-project infrastructure.
How it got here
2016–2017 — sbt 2.x upgrade and API simplification
9 changes.
The project upgraded its build infrastructure to support sbt 2.x and modern Scala versions, establishing new baseline requirements for Scala.js and Scala Native. This period focused on simplifying the cross-project API by enforcing explicit platform arguments and adding Scala 3 support, while restoring JSPlatform definitions for smoother integration. Comprehensive scripted tests were added to verify backward compatibility and the correct behavior of the new API across JVM, JS, and Native platforms.
2018 — Scala Native support and API refinements
5 changes.
This period focused on extending sbt-crossproject capabilities by introducing the sbt-scala-native-crossproject plugin to support Scala Native targets. The work also included refining the core API with the new withoutSuffixFor method and fixing default name resolution issues, alongside adding automated formatting scripts and comprehensive test coverage for composite project inheritance.
2019–2022 — Cross-project source and resource management
6 changes.
This period focused on enhancing sbt-crossproject to support more granular source organization, including epoch-versioned directories and partially-shared sources for specific platform subsets. It also introduced support for shared resources in cross-project builds and expanded the test suite to verify these new capabilities across JVM, JS, and Native targets.
Features
Add \`crossProject.withoutSuffixFor\` API
The \crossProject.withoutSuffixFor(platform)\ method is now available, allowing users to configure specific platforms to not receive a suffix in their project identifiers. This change enables more flexible cross-project configurations where certain targets can be named without the standard platform-specific suffixes.
sbt-crossproject-test/src/sbt-test/new-api/without-suffix-for · high confidence
Automated Scalafmt installation and execution via scripts
The repository now includes a \scripts/scalafmt\ executable that automatically downloads and bootstraps the Coursier launcher and Scalafmt CLI (v0.4.7) if they are not already present, allowing users to run code formatting without pre-installing these tools.
scripts · high confidence
Introduce sbt-scala-native-crossproject plugin
Adds the sbt-scala-native-crossproject plugin, providing a NativePlatform definition and implicit extension methods (native, nativeSettings, nativeEnablePlugins) to configure Scala Native targets within sbt-crossproject workflows.
sbt-scala-native-crossproject · high confidence
Support for epoch-versioned source directories in cross-compiled projects
The cross-project build system now recognizes source directories named with major Scala version epochs (e.g., \scala-2\, \scala-3\) in addition to specific binary versions (e.g., \scala-2.12\, \scala-2.13\). This allows shared code to be organized by major version compatibility, ensuring that files in \scala-2\ are included for all 2.x builds while \scala-3\ files are used for 3.x builds, as demonstrated by the new test case that compiles and runs code dependent on these epoch-specific sources.
sbt-crossproject-test/src/sbt-test/new-api/shared-cross-sources · high confidence
Support for partially-shared source directories in cross-projects
Users can now organize cross-project sources using partially-shared directories (e.g., \js-jvm\, \jvm-native\), allowing code to be shared between specific subsets of platforms rather than all of them. This change enables more granular source management where platform-specific logic can be co-located with shared logic for a subset of targets, as demonstrated by the new test case verifying correct compilation and runtime behavior across JVM, JS, and Native targets.
sbt-crossproject-test/src/sbt-test/new-api/partially-shared-sources · high confidence
Support for shared resources in cross-project builds
Users can now include shared resources in cross-project setups, allowing code in shared modules to access resource files at runtime. This is demonstrated by a test case where a Scala object verifies the availability of a resource file named 'bar' via getClass.getResource, ensuring that shared resources are correctly packaged and accessible across JVM targets.
sbt-crossproject-test/src/sbt-test/new-api/shared-resources · high confidence
Behavioural changes
Restores JSPlatform and simplifies Scala.js cross-project API
The sbt-scalajs-crossproject plugin now includes the JSPlatform definition directly within the scalajscrossproject package, resolving issues that blocked migration to sbt-crossproject. This change restores the JSPlatform object and exposes it via the ScalaJSCrossPlugin's autoImport, allowing users to configure JavaScript-specific projects using the standard cross-project DSL (e.g., .js, .jsSettings, .jsEnablePlugins) without needing external platform definitions. The plugin also simplifies its public API by removing unnecessary traits, making the integration with Scala.js more straightforward and aligned with current sbt-crossproject standards.
sbt-scalajs-crossproject · high confidence
Simplified cross-project API with explicit platform arguments and Scala 3 support
The sbt-crossproject plugin now requires users to explicitly specify platforms (e.g., \crossProject(JSPlatform, JVMPlatform)\) instead of relying on implicit defaults, with the old no-argument syntax deprecated. This change introduces a cleaner public API, adds support for Scala 3 via new macro implementations, and enforces stricter dependency checks to prevent cross-project mismatches. It also adds settings for base directories and cross-types, and supports shared and partially shared source directories.
sbt-crossproject · high confidence
Updated to sbt-crossproject 1.4.0 with new platform requirements and documentation
The project has been updated to version 1.4.0, which raises the minimum requirements to sbt 1.11.5+ (or sbt 2.0.6+), JDK 17+, Scala.js 1.22.0+, and Scala Native 0.5.11+. The README has been significantly expanded to document installation for cross-compiling Scala.js, JVM, and Native platforms, including specific plugin versions and build.sbt configurations. It also details the \withoutSuffixFor\ feature for simplifying project IDs in the sbt prompt, explains how to detect the current platform in settings, and provides examples for different CrossType layouts (Pure, Full, Dummy). Additionally, a .scalafmt.conf file has been added to enforce code formatting, and the .gitignore has been updated to exclude sbt-test artifacts and script caches.
(repo-wide) · high confidence
Fixes
Fix default name resolution in cross-project builds
Resolves an issue where the project name did not default to the cross-project's ID, ensuring that cross-project builds correctly inherit the expected name configuration.
sbt-crossproject-test/src/sbt-test/new-api/name · high confidence
Test coverage
Add composite project test for CrossProject inheritance; Added new-api integration tests for cross-project aggregates and dependencies; Added sbt-test for Scala Native-only crossproject usage; Added scripted tests for backward compatibility; Added scripted tests for cross-project dependency scenarios; Added test for new API plugins; Added test plugin definitions for JVM, JS, and Native platforms; Added tests for cross-project detection and base directory settings.
Dependencies
Upgrade build infrastructure to sbt 1.12.9 with MiMa and CI-release plugins
The project's build system has been upgraded to sbt version 1.12.9, replacing the previous version. This update introduces the sbt-mima-plugin (version 1.1.6) for binary compatibility checking against the previous version 1.4.0, and the sbt-ci-release plugin (version 1.11.2) to streamline publishing workflows. Additionally, a new Extra.scala file centralizes publishing settings, ScalaDoc generation from README, and scripted test folder duplication logic.
project · high confidence
Upgrade to sbt 2.x support with updated Scala.js and Scala Native baselines
The build configuration now targets sbt 2.x, establishing Scala.js 1.22.0 and Scala Native 0.5.11 as the baseline versions required for sbt 2 compatibility. The \sbt-crossproject\ plugin itself is updated to version 1.0.2 of \sbt-platform-deps\ for sbt 1.x builds, while the test suite verifies the new API behavior across JS, JVM, and Native platforms.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 57.
Lenses
- Code Health 100
- Architecture 100
- Maturity 53
- Readiness 43
- Security 75
Changes since last survey
- 167 commits — 148 feature/other, 19 fixes
By area
- (root) — 52 commits
- (repo) — 34 commits
- sbt-crossproject-test/src — 23 commits
- project/Extra.scala — 20 commits
- sbt-crossproject/src — 13 commits
- .github/workflows — 10 commits
- src/main — 5 commits
- sbt-cross-test/src — 4 commits
- project/build.properties — 3 commits
- project/plugins.sbt — 1 commit
- sbt-scalajs-crossproject/src — 1 commit
- scripts/check-cla.sh — 1 commit
Notable commits
- fix: Fix #52: No warn when depending on a cross-project with more platforms.
- fix: Fix #80: Make name default to the cross-project's ID.
- fix: Fix #83: Move JSPlatform back to scalajscrossproject (#87)
- fix: Fix deprecated sbt syntax
- fix: Fix deprecated sbt syntax in test
- fix: Fix issues blocking Scala.js' master from migrating to sbt-crossproject (#38)
- fix: Fix release.yml
- fix: Fix the dependency on sbt-scalajs when cross-building for sbt 1.0. (#56)
- fix: Fix the example settings of foo in the README (#105)
- fix: Fix the reference to JSPlatform in the readme. (#82)
- fix: Merge pull request #140 from sjrd/fix-project-url
- fix: Merge pull request #155 from sjrd/fix-publishing
- fix: Merge pull request #156 from armanbilge/fix/cross-project-base-dir
- fix: Merge pull request #165 from xuwei-k/fix-warnings
- fix: Move repository-wide settings to inThisBuild to fix publishing.
- fix: fix #12, fix #13 (#14)
- fix: fix build error
- fix: fix groupId in README. s/scala-native/org.portable-scala/
- fix: fix warnings
- change: Add crossProject.withoutSuffixFor(platform).
- …and 147 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
portable-scala/sbt-crossproject was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit bdc671e4bf14baf85b36d43b5d22e5e48ced4abf — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.