-
Notifications
You must be signed in to change notification settings - Fork 407
/
build.sbt
121 lines (112 loc) · 3.41 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
113
114
115
116
117
118
119
120
121
val Scala212 = "2.12.20"
val Scala213 = "2.13.15"
val Scala3 = "3.3.4"
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 = Nil
),
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 = Nil
)
)
ThisBuild / tlBaseVersion := "1.18"
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)
.settings(
Compile / headerSources ++= Seq(
"codegen.scala",
"CustomHeaderPlugin.scala"
).map {
BuildPaths.projectStandard((ThisBuild / baseDirectory).value) / _
}
)
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.17.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", "3").map(_ -> "1.18.0").toMap
)
lazy val bench = project.in(file("bench"))
.dependsOn(core.jvm)
.settings(
name := "scalacheck-bench",
fork := true
)
.enablePlugins(NoPublishPlugin, JmhPlugin)