forked from dotty-staging/scalacheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
112 lines (102 loc) · 3.3 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
val Scala212 = "2.12.16"
val Scala213 = "2.13.8"
val Scala3 = "3.1.2"
name := "scalacheck"
ThisBuild / organization := "org.scalacheck"
ThisBuild / organizationName := "Typelevel"
ThisBuild / homepage := Some(url("http://www.scalacheck.org"))
ThisBuild / licenses := Seq("BSD 3-clause" -> url("https://opensource.org/licenses/BSD-3-Clause"))
ThisBuild / developers := List(
Developer(
id = "rickynils",
name = "Rickard Nilsson",
email = "[email protected]",
url = url("https://github.com/rickynils")
)
)
ThisBuild / tlCiReleaseBranches := Seq("main")
ThisBuild / crossScalaVersions := Seq(Scala3, Scala212, Scala213)
val Java8 = JavaSpec.temurin("8")
ThisBuild / githubWorkflowJavaVersions := Seq(Java8, JavaSpec.temurin("11"))
ThisBuild / githubWorkflowBuildMatrixAdditions += "workers" -> List("1", "4")
ThisBuild / githubWorkflowBuildMatrixExclusions ++=
List(
MatrixExclude(Map("project" -> "rootJS", "workers" -> "4")),
MatrixExclude(Map("project" -> "rootNative", "workers" -> "4"))
)
ThisBuild / githubWorkflowAddedJobs ++= Seq(
WorkflowJob(
"examples",
"Examples",
githubWorkflowJobSetup.value.toList ::: List(
WorkflowStep.Run(
List(
"cd examples",
"for d in */ ; do cd \"$d\" && sbt test:compile && cd ../ ; done"),
name = Some("Build examples"))),
javas = List(Java8),
scalas = List((ThisBuild / scalaVersion).value)),
WorkflowJob(
"bench",
"Bench",
githubWorkflowJobSetup.value.toList ::: List(
WorkflowStep.Sbt(
List("bench/jmh:run -p genSize=0 -p seedCount=0 -bs 1 -wi 0 -i 1 -f 0 -t 1 -r 0 org.scalacheck.bench.GenBench"),
name = Some("Build benchmark suite"))),
javas = List(Java8),
scalas = List((ThisBuild / scalaVersion).value)))
ThisBuild / tlBaseVersion := "1.17"
ThisBuild / tlMimaPreviousVersions ++= Set(
// manually added because tags are not v-prefixed
"1.14.0",
"1.14.1",
"1.14.2",
"1.14.3",
"1.15.0",
"1.15.1",
"1.15.2",
"1.15.3",
"1.15.4",
)
ThisBuild / tlVersionIntroduced := Map("3" -> "1.15.3")
lazy val root = tlCrossRootProject.aggregate(core, bench)
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("core"))
.settings(
name := "scalacheck",
Compile / sourceGenerators += task {
val dir = (Compile / sourceManaged).value / "org" / "scalacheck"
codegen.genAll.map { s =>
val f = dir / s.name
IO.write(f, s.code)
f
}
},
tlFatalWarnings := false // TODO
)
.jvmSettings(
Test / fork := true,
libraryDependencies ++= Seq(
"org.apache.commons" % "commons-lang3" % "3.12.0" % Test,
"org.scala-sbt" % "test-interface" % "1.0"
)
)
.jsSettings(
libraryDependencies +=
("org.scala-js" %% "scalajs-test-interface" % scalaJSVersion).cross(CrossVersion.for3Use2_13),
tlVersionIntroduced ++= List("2.12", "2.13").map(_ -> "1.14.3").toMap
)
.nativeSettings(
libraryDependencies ++= Seq(
"org.scala-native" %%% "test-interface" % nativeVersion
),
tlVersionIntroduced ++=
List("2.12", "2.13").map(_ -> "1.15.2").toMap ++ Map("3" -> "1.16.0")
)
lazy val bench = project.in(file("bench"))
.dependsOn(core.jvm)
.settings(
name := "scalacheck-bench",
fork := true,
)
.enablePlugins(NoPublishPlugin, JmhPlugin)