1
- ThisBuild / crossScalaVersions := Seq (" 2.13.15" , " 3.3.4" )
1
+ val scalaVersions = Seq (" 2.13.15" , " 3.3.4" )
2
+ ThisBuild / crossScalaVersions := scalaVersions
2
3
ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.head
3
4
5
+ Global / concurrentRestrictions += Tags .limit(NativeTags .Link , 1 )
4
6
Global / cancelable := true
5
7
publish / skip := true // in root
6
8
@@ -18,43 +20,78 @@ lazy val commonSettings: Seq[Setting[_]] =
18
20
}),
19
21
)
20
22
21
- lazy val core = project.in(file(" core" ))
23
+ lazy val testNativeSettings : Seq [Setting [_]] = Seq (
24
+ // Required by Scala Native testing infrastructure
25
+ Test / fork := false ,
26
+ )
27
+
28
+ lazy val core = projectMatrix.in(file(" core" ))
22
29
.settings(commonSettings)
23
30
.settings(
24
31
name := " scala-parallel-collections" ,
25
32
Compile / doc / autoAPIMappings := true ,
26
33
)
34
+ .jvmPlatform(scalaVersions)
35
+ .nativePlatform(scalaVersions, settings = testNativeSettings ++ Seq (
36
+ versionPolicyPreviousArtifacts := Nil , // TODO: not yet published ,
37
+ mimaPreviousArtifacts := Set .empty
38
+ ))
27
39
28
- lazy val junit = project .in(file(" junit" ))
40
+ lazy val junit = projectMatrix .in(file(" junit" ))
29
41
.settings(commonSettings)
30
42
.settings(
31
- libraryDependencies += " com.github.sbt" % " junit-interface" % " 0.13.3" % Test ,
32
- libraryDependencies += " junit" % " junit" % " 4.13.2" % Test ,
33
- // for javax.xml.bind.DatatypeConverter, used in SerializationStabilityTest
34
- libraryDependencies += " javax.xml.bind" % " jaxb-api" % " 2.3.1" % Test ,
35
43
testOptions += Tests .Argument (TestFrameworks .JUnit , " -a" , " -v" ),
36
- Test / fork := true ,
37
44
publish / skip := true ,
38
45
).dependsOn(testmacros, core)
46
+ .jvmPlatform(scalaVersions,
47
+ settings = Seq (
48
+ libraryDependencies += " com.github.sbt" % " junit-interface" % " 0.13.3" % Test ,
49
+ libraryDependencies += " junit" % " junit" % " 4.13.2" % Test ,
50
+ // for javax.xml.bind.DatatypeConverter, used in SerializationStabilityTest
51
+ libraryDependencies += " javax.xml.bind" % " jaxb-api" % " 2.3.1" % Test ,
52
+ Test / fork := true ,
53
+ )
54
+ )
55
+ .nativePlatform(scalaVersions = scalaVersions,
56
+ axisValues = Nil ,
57
+ configure = _
58
+ .enablePlugins(ScalaNativeJUnitPlugin )
59
+ .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
67
+ )
68
+ )
39
69
40
- lazy val scalacheck = project .in(file(" scalacheck" ))
70
+ lazy val scalacheck = projectMatrix .in(file(" scalacheck" ))
41
71
.settings(commonSettings)
42
72
.settings(
43
- libraryDependencies += " org.scalacheck" %% " scalacheck" % " 1.18.1" ,
44
- Test / fork := true ,
73
+ libraryDependencies += " org.scalacheck" %%% " scalacheck" % " 1.18.1" ,
45
74
Test / testOptions += Tests .Argument (TestFrameworks .ScalaCheck , " -workers" , " 1" , " -minSize" , " 0" , " -maxSize" , " 4000" , " -minSuccessfulTests" , " 5" ),
46
75
publish / skip := true
47
76
).dependsOn(core)
77
+ .jvmPlatform(scalaVersions,
78
+ settings = Seq (
79
+ Test / fork := true
80
+ )
81
+ )
82
+ .nativePlatform(scalaVersions, settings = testNativeSettings)
48
83
49
- lazy val testmacros = project .in(file(" testmacros" ))
84
+ lazy val testmacros = projectMatrix .in(file(" testmacros" ))
50
85
.settings(commonSettings)
51
86
.settings(
52
- libraryDependencies += (CrossVersion .partialVersion(scalaVersion.value) match {
53
- case Some ((3 , _)) => scalaOrganization.value %% " scala3-compiler " % scalaVersion.value
54
- case _ => scalaOrganization.value % " scala-compiler" % scalaVersion.value
87
+ libraryDependencies ++ = (CrossVersion .partialVersion(scalaVersion.value) match {
88
+ case Some ((3 , _)) => Nil
89
+ case _ => List ( scalaOrganization.value % " scala-compiler" % scalaVersion.value)
55
90
}),
56
91
publish / skip := true ,
57
92
)
93
+ .jvmPlatform(scalaVersions)
94
+ .nativePlatform(scalaVersions, settings = testNativeSettings)
58
95
59
96
commands += Command .single(" setScalaVersion" ) { (state, arg) =>
60
97
val command = arg match {
0 commit comments