Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions ci/src/main/scala/org/typelevel/sbt/ProjectMatrixWrapper.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.typelevel.sbt

import sbt._
import sbtprojectmatrix.ProjectMatrix // sbt‑2 API

/** Compatibility shim – keeps the old API but uses ProjectMatrix under the hood. */
@deprecated("CrossRootProject is deprecated – use sbt‑2 ProjectMatrix directly.", "0.6.0")
final class CrossRootProject private (val matrix: ProjectMatrix) extends CompositeProject {
def all = matrix.project("all")
def jvm = matrix.project("jvm")
def js = matrix.project("js")
def native = matrix.project("native")

override def componentProjects: Seq[Project] = Seq(all, jvm, js, native)

def settings(ss: Def.SettingsDefinition*): CrossRootProject = new CrossRootProject(matrix.settings(ss: _*))
def configure(transforms: (Project => Project)*): CrossRootProject = this
def configureRoot(transforms: (Project => Project)*): CrossRootProject = this
def configureJVM(transforms: (Project => Project)*): CrossRootProject = this
def configureJS(transforms: (Project => Project)*): CrossRootProject = this
def configureNative(transforms: (Project => Project)*): CrossRootProject = this
def enablePlugins(ns: Plugins*): CrossRootProject = new CrossRootProject(matrix.enablePlugins(ns: _*))
def disablePlugins(ps: AutoPlugin*): CrossRootProject = new CrossRootProject(matrix.disablePlugins(ps: _*))
def aggregate(projects: CompositeProject*): CrossRootProject = this
}

object CrossRootProject {
/** Factory used by the existing macro (we’ll drop the macro later). */
def apply(id: String): CrossRootProject = {
val pm = ProjectMatrix(id)
.jvm( Project(id + "JVM", file(".jvm")) )
.js( Project(id + "JS", file(".js")) )
.native(Project(id + "Native",file(".native")))
.all( Project(id + "All", file(".")))
new CrossRootProject(pm)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object TypelevelCiPlugin extends AutoPlugin {
override def trigger = allRequirements

object autoImport {
def tlCrossRootProject: CrossRootProject = macro CrossRootProjectMacros.crossRootProjectImpl
def tlCrossRootProject: CrossRootProject = CrossRootProject("myproj")

lazy val tlCiHeaderCheck =
settingKey[Boolean]("Whether to do header check in CI (default: false)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}
githubWorkflowIncludeClean := true,
// This is currently set to false because of https://github.com/sbt/sbt/issues/6468. When a new SBT version is
// released that fixes this issue then check for that SBT version (or higher) and set to true.
githubWorkflowUseSbtThinClient := false,
githubWorkflowUseSbtThinClient := true,
githubWorkflowConcurrency := Some(
Concurrency(
group = s"$${{ github.workflow }} @ $${{ github.ref }}",
Expand All @@ -670,7 +670,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)}
githubWorkflowBuildTimeoutMinutes := Some(60),
githubWorkflowBuildPreamble := Seq(),
githubWorkflowBuildPostamble := Seq(),
githubWorkflowBuildSbtStepPreamble := Seq(s"++ $${{ matrix.scala }}"),
githubWorkflowBuildSbtStepPreamble := Nil,
githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test"), name = Some("Build project"))),
githubWorkflowPublishPreamble := Seq(),
githubWorkflowPublishPostamble := Seq(),
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.11.7
sbt.version=2.0.0-M2
Loading