Skip to content

Commit 350a2be

Browse files
committed
Don't create Scala binary specific subprojects
1 parent c6ec43d commit 350a2be

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

build.sbt

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
val scalaVersions = Seq("2.13.15", "3.3.4")
2+
val defaultScalaVersion = scalaVersions.head
3+
4+
// When defining JVM / Scala Native matrix we don't want duplicated projects for Scala 2/3
5+
val matrixScalaVersions = Seq(defaultScalaVersion)
6+
27
ThisBuild / crossScalaVersions := scalaVersions
3-
ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.head
8+
ThisBuild / scalaVersion := defaultScalaVersion
49

510
Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1)
611
Global / cancelable := true
@@ -10,6 +15,7 @@ lazy val commonSettings: Seq[Setting[_]] =
1015
Seq(scalaModuleAutomaticModuleName := Some("scala.collection.parallel")) ++
1116
ScalaModulePlugin.scalaModuleSettings ++ Seq(
1217
versionPolicyIntention := Compatibility.BinaryAndSourceCompatible,
18+
crossScalaVersions := scalaVersions,
1319
Compile / compile / scalacOptions --= (CrossVersion.partialVersion(scalaVersion.value) match {
1420
case Some((3, _)) => Seq("-Xlint")
1521
case _ => Seq()
@@ -31,9 +37,9 @@ lazy val core = projectMatrix.in(file("core"))
3137
name := "scala-parallel-collections",
3238
Compile / doc / autoAPIMappings := true,
3339
)
34-
.jvmPlatform(scalaVersions)
35-
.nativePlatform(scalaVersions, settings = testNativeSettings ++ Seq(
36-
versionPolicyPreviousArtifacts := Nil, // TODO: not yet published ,
40+
.jvmPlatform(matrixScalaVersions)
41+
.nativePlatform(matrixScalaVersions, settings = testNativeSettings ++ Seq(
42+
versionPolicyPreviousArtifacts := Nil, // TODO: not yet published
3743
mimaPreviousArtifacts := Set.empty
3844
))
3945

@@ -43,7 +49,7 @@ lazy val junit = projectMatrix.in(file("junit"))
4349
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"),
4450
publish / skip := true,
4551
).dependsOn(testmacros, core)
46-
.jvmPlatform(scalaVersions,
52+
.jvmPlatform(matrixScalaVersions,
4753
settings = Seq(
4854
libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % Test,
4955
libraryDependencies += "junit" % "junit" % "4.13.2" % Test,
@@ -52,18 +58,18 @@ lazy val junit = projectMatrix.in(file("junit"))
5258
Test / fork := true,
5359
)
5460
)
55-
.nativePlatform(scalaVersions = scalaVersions,
61+
.nativePlatform(matrixScalaVersions,
5662
axisValues = Nil,
5763
configure = _
5864
.enablePlugins(ScalaNativeJUnitPlugin)
5965
.settings(
60-
Test/unmanagedSources/excludeFilter ~= { _ ||
61-
"SerializationTest.scala" || // requires ObjectOutputStream
62-
"SerializationStability.scala" || // requires jaxb-api
63-
"SerializationStabilityBase.scala" ||
64-
"SerializationStabilityTest.scala"
65-
},
66-
Test / fork := false
66+
Test/unmanagedSources/excludeFilter ~= { _ ||
67+
"SerializationTest.scala" || // requires ObjectOutputStream
68+
"SerializationStability.scala" || // requires jaxb-api
69+
"SerializationStabilityBase.scala" ||
70+
"SerializationStabilityTest.scala"
71+
},
72+
Test / fork := false
6773
)
6874
)
6975

@@ -73,13 +79,14 @@ lazy val scalacheck = projectMatrix.in(file("scalacheck"))
7379
libraryDependencies += "org.scalacheck" %%% "scalacheck" % "1.18.1",
7480
Test / testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-workers", "1", "-minSize", "0", "-maxSize", "4000", "-minSuccessfulTests", "5"),
7581
publish / skip := true
76-
).dependsOn(core)
77-
.jvmPlatform(scalaVersions,
78-
settings = Seq(
79-
Test / fork := true
80-
)
82+
)
83+
.dependsOn(core)
84+
.jvmPlatform(matrixScalaVersions,
85+
settings = Seq(
86+
Test / fork := true
8187
)
82-
.nativePlatform(scalaVersions, settings = testNativeSettings)
88+
)
89+
.nativePlatform(matrixScalaVersions, settings = testNativeSettings)
8390

8491
lazy val testmacros = projectMatrix.in(file("testmacros"))
8592
.settings(commonSettings)
@@ -90,8 +97,8 @@ lazy val testmacros = projectMatrix.in(file("testmacros"))
9097
}),
9198
publish / skip := true,
9299
)
93-
.jvmPlatform(scalaVersions)
94-
.nativePlatform(scalaVersions, settings = testNativeSettings)
100+
.jvmPlatform(matrixScalaVersions)
101+
.nativePlatform(matrixScalaVersions, settings = testNativeSettings)
95102

96103
commands += Command.single("setScalaVersion") { (state, arg) =>
97104
val command = arg match {

0 commit comments

Comments
 (0)