Skip to content

Commit

Permalink
switch from crossproject to projectmatrix due to compat with stryker
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianhjr committed Sep 27, 2023
1 parent 27d91d5 commit 76ba45a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
54 changes: 27 additions & 27 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import sbt.Keys.publishTo
import sbt.Project.projectToRef
import sbtcrossproject.CrossProject

// Globals

Expand Down Expand Up @@ -57,10 +55,11 @@ val sharedSettings = Seq(

ThisBuild / wartremoverErrors ++= Warts.unsafe

val core: CrossProject =
crossProject(JVMPlatform, NativePlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("core"))
val core =
(projectMatrix in file("core"))
.jsPlatform(scalaVersions = Seq(Version.scala))
.jvmPlatform(scalaVersions = Seq(Version.scala))
.nativePlatform(scalaVersions = Seq(Version.scala))
.settings(sharedSettings)
.settings(
name := "bijection-core",
Expand All @@ -73,10 +72,11 @@ val core: CrossProject =
)
)

val scalacheck: CrossProject =
crossProject(JVMPlatform, NativePlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("scalacheck"))
val scalacheck =
(projectMatrix in file("scalacheck"))
.jsPlatform(scalaVersions = Seq(Version.scala))
.jvmPlatform(scalaVersions = Seq(Version.scala))
.nativePlatform(scalaVersions = Seq(Version.scala))
.dependsOn(core)
.settings(sharedSettings)
.settings(
Expand All @@ -89,10 +89,11 @@ val scalacheck: CrossProject =
)
)

val scalatest: CrossProject =
crossProject(JVMPlatform, NativePlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("scalatest"))
val scalatest =
(projectMatrix in file("scalatest"))
.jsPlatform(scalaVersions = Seq(Version.scala))
.jvmPlatform(scalaVersions = Seq(Version.scala))
.nativePlatform(scalaVersions = Seq(Version.scala))
.dependsOn(core)
.settings(sharedSettings)
.settings(
Expand All @@ -104,31 +105,30 @@ val scalatest: CrossProject =
)
)

val root: CrossProject =
crossProject(JVMPlatform, NativePlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("."))
val rootMatrix =
(projectMatrix in file("."))
.jsPlatform(scalaVersions = Seq(Version.scala))
.jvmPlatform(scalaVersions = Seq(Version.scala))
.nativePlatform(scalaVersions = Seq(Version.scala))
.aggregate(core, scalacheck, scalatest)
.dependsOn(core)
.enablePlugins(ScalaUnidocPlugin)
.settings(sharedSettings)
.settings(name := "bijection")
.enablePlugins(ScalaUnidocPlugin)
.settings(
name := "bijection",
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(thisProject.value.aggregate*)
)

// To avoid publishing the default root package / `bijection-scala`

val fakeRoot = (project in file("."))
.settings(
publish / skip := true,
sourceDirectory := file("fake")
)
.aggregate(root.componentProjects.map(projectToRef)*)
val root = (project in file("fake"))
.aggregate(rootMatrix.projectRefs*)
.settings(sharedSettings)
.settings(publish / skip := true)

// CI/CD

import JavaSpec.Distribution
import sbtghactions.GenerativePlugin.autoImport.JavaSpec.Distribution

ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec(Distribution.Zulu, "17"),
Expand Down
7 changes: 3 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ ThisBuild / libraryDependencySchemes += "org.scala-native" % "sbt-scala-native"

// CrossPlatform

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.15")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2")
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.1")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.15")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2")

// Documentation

Expand Down

0 comments on commit 76ba45a

Please sign in to comment.