forked from scala/scala-parallel-collections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
76 lines (67 loc) · 2.88 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
ThisBuild / crossScalaVersions := Seq("2.13.8", "3.0.2")
ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.head
// shouldn't be necessary anymore after https://github.com/lampepfl/dotty/pull/13498
// makes it into a release
ThisBuild / libraryDependencySchemes += "org.scala-lang" %% "scala3-library" % "semver-spec"
// this was necessary to get us from 3.0.0 to 3.0.2, but we should be able to remove
// it after the next release
import com.typesafe.tools.mima.core._
ThisBuild / mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[IncompatibleSignatureProblem]("*"),
)
Global / cancelable := true
publish / skip := true // in root
lazy val commonSettings: Seq[Setting[_]] =
Seq(scalaModuleAutomaticModuleName := Some("scala.collection.parallel")) ++
ScalaModulePlugin.scalaModuleSettings ++ Seq(
versionPolicyIntention := Compatibility.BinaryCompatible,
Compile / compile / scalacOptions --= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq("-Xlint")
case _ => Seq()
}),
Compile / compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq()
case _ => Seq("-Werror"),
}),
)
lazy val core = project.in(file("core"))
.settings(commonSettings)
.settings(
name := "scala-parallel-collections",
Compile / doc / autoAPIMappings := true,
)
lazy val junit = project.in(file("junit"))
.settings(commonSettings)
.settings(
libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % Test,
libraryDependencies += "junit" % "junit" % "4.13.2" % Test,
// for javax.xml.bind.DatatypeConverter, used in SerializationStabilityTest
libraryDependencies += "javax.xml.bind" % "jaxb-api" % "2.3.1" % Test,
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"),
Test / fork := true,
publish / skip := true,
).dependsOn(testmacros, core)
lazy val scalacheck = project.in(file("scalacheck"))
.settings(commonSettings)
.settings(
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.15.4",
Test / fork := true,
Test / testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-workers", "1", "-minSize", "0", "-maxSize", "4000", "-minSuccessfulTests", "5"),
publish / skip := true
).dependsOn(core)
lazy val testmacros = project.in(file("testmacros"))
.settings(commonSettings)
.settings(
libraryDependencies += (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => scalaOrganization.value %% "scala3-compiler" % scalaVersion.value
case _ => scalaOrganization.value % "scala-compiler" % scalaVersion.value
}),
publish / skip := true,
)
commands += Command.single("setScalaVersion") { (state, arg0) =>
val arg = arg0 match {
case "3.next" => GetScala3Next.get()
case _ => arg0
}
s"++$arg" :: state
}