-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
127 lines (117 loc) · 5.15 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
122
123
124
125
126
127
import sbt.Tests.{Group, SubProcess}
import sbtrelease.ReleaseStateTransformations.*
import java.io.OutputStream
lazy val javaVersion = "17"
lazy val scala2_13_Version = "2.13.16"
lazy val scala3_Version = "3.3.4"
ThisBuild / scalaVersion := scala2_13_Version
lazy val settings = Seq(
crossScalaVersions := Seq(scala2_13_Version, scala3_Version),
pomIncludeRepository := { _ => false },
publishMavenStyle := true,
licenses += ("MIT", url("https://opensource.org/licenses/MIT")),
organization := "com.sageserpent",
organizationName := "sageserpent",
description := "Generation of test data for parameterised testing",
releaseCrossBuild := false, // Don't use the support for cross-building provided by `sbt-release`....
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
releaseStepCommandAndRemaining(
"+clean"
), // ... instead, cross-build the clean step using SBT's own mechanism ...
releaseStepCommandAndRemaining(
"+test"
), // ... and the testing step using SBT's own mechanism ...
setReleaseVersion,
commitReleaseVersion,
tagRelease,
// *DO NOT* run `+publishSigned`, `sonatypeBundleRelease` and `pushChanges`
// - the equivalent is done on GitHub by
// `gha-scala-library-release-workflow`.
setNextVersion,
commitNextVersion
),
name := "americium",
scalacOptions ++= (CrossVersion.partialVersion(
scalaVersion.value
) match {
case Some((2, _)) =>
Seq("-Xsource:3", s"-java-output-version:$javaVersion")
case Some((3, _)) =>
Seq("-explain", s"-java-output-version:$javaVersion")
case _ => Nil
}),
javacOptions ++= Seq("-source", javaVersion, "-target", javaVersion),
libraryDependencies ++= (CrossVersion.partialVersion(
scalaVersion.value
) match {
case Some((2, _)) =>
Seq(
"com.softwaremill.magnolia1_2" %% "magnolia" % "1.1.10",
"org.scala-lang" % "scala-reflect" % scalaVersion.value
)
case Some((3, _)) =>
Seq("com.softwaremill.magnolia1_3" %% "magnolia" % "1.3.9")
case _ => Seq.empty
}),
Test / test / logLevel := Level.Error,
Test / testOptions += Tests.Argument(jupiterTestFramework, "-q"),
Test / testGrouping := {
val tests = (Test / definedTests).value
tests
.groupBy(_.name)
.map { case (groupName, group) =>
new Group(
groupName,
group,
SubProcess(
(Test / forkOptions).value
.withRunJVMOptions(
Vector(
s"-Dtrials.runDatabase=trialsRunDatabaseForGroup$groupName"
)
)
.withOutputStrategy(
OutputStrategy.CustomOutput(OutputStream.nullOutputStream)
)
)
)
}
.toSeq
},
Global / concurrentRestrictions := Seq(Tags.limit(Tags.ForkedTestGroup, 6)),
Test / fork := true,
Test / testForkedParallel := false,
libraryDependencies += "org.typelevel" %% "cats-core" % "2.12.0",
libraryDependencies += "org.typelevel" %% "cats-free" % "2.12.0",
libraryDependencies += "org.typelevel" %% "cats-collections-core" % "0.9.9",
libraryDependencies += "co.fs2" %% "fs2-core" % "3.11.0",
libraryDependencies += "io.circe" %% "circe-core" % "0.14.10",
libraryDependencies += "io.circe" %% "circe-generic" % "0.14.10",
libraryDependencies += "io.circe" %% "circe-parser" % "0.14.10",
libraryDependencies += "com.google.guava" % "guava" % "33.4.0-jre",
libraryDependencies += "com.oath.cyclops" % "cyclops" % "10.4.1",
libraryDependencies += "org.junit.jupiter" % "junit-jupiter-params" % "5.11.4",
libraryDependencies += "org.junit.platform" % "junit-platform-launcher" % "1.11.4",
libraryDependencies += "org.rocksdb" % "rocksdbjni" % "9.8.4",
libraryDependencies += "org.apache.commons" % "commons-text" % "1.13.0",
libraryDependencies += "com.lihaoyi" %% "pprint" % "0.9.0",
libraryDependencies += "org.typelevel" %% "cats-laws" % "2.12.0" % Test,
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.19" % Test,
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.18.1" % Test,
libraryDependencies += "org.scalatestplus" %% "scalacheck-1-16" % "3.2.14.0" % Test,
libraryDependencies += "org.mockito" % "mockito-core" % "5.15.2" % Test,
libraryDependencies += "org.mockito" % "mockito-junit-jupiter" % "5.15.2" % Test,
libraryDependencies += "com.github.seregamorph" % "hamcrest-more-matchers" % "1.0" % Test,
libraryDependencies += "com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test,
libraryDependencies ++= Seq(
"org.junit.platform" % "junit-platform-runner" % "1.11.4" % Test,
"org.junit.jupiter" % "junit-jupiter-engine" % "5.11.4" % Test
),
libraryDependencies += "org.hamcrest" % "hamcrest" % "3.0" % Test,
libraryDependencies += "com.eed3si9n.expecty" %% "expecty" % "0.17.0" % Test
)
lazy val americium = (project in file("."))
.settings(settings: _*)
.disablePlugins(plugins.JUnitXmlReportPlugin)