Skip to content

Replace sbt-crossproject with sbt-projectmatrix - #918

Draft
zainab-ali wants to merge 1 commit into
typelevel:mainfrom
zainab-ali:project-matrix
Draft

Replace sbt-crossproject with sbt-projectmatrix#918
zainab-ali wants to merge 1 commit into
typelevel:mainfrom
zainab-ali:project-matrix

Conversation

@zainab-ali

Copy link
Copy Markdown

This is a POC for replacing cross project with project matrix.

Exactly how it should be incorporated is up for discussion. For example, we could support different plugins for cross project and project matrix for SBT 1, or only support project matrix for SBT 2.0.

Status

It compiles and publishes locally, and works for itself (the sbt-typelevel build) and weaver. It needs to be tested on many other projects. Note that the GitHub actions pipeline can't be tested in other projects until a snapshot is published.

API changes

Users will need to rewrite their builds to use projectMatrix. The actual API surface of sbt-typelevel is mostly the same. The main changes are:
-CrossRootProject needs a list of scala versions to be passed to it.

  • The CrossRootProject.aggregate function must be passed ProjectMatrix composite projects. For non-matrix projects, the aggregate function needs to be given a specific scala version. This is because a project definition doesn't contain enough information to determine its scala version.
  • The TypelevelBspPlugin uses PlatformAxis instead of cross project's Platform type.
  • The ++ {{ matrix.scala }} in generated workflows has been replaced with a scala version suffix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant