-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sbt
More file actions
179 lines (166 loc) · 4.82 KB
/
Copy pathbuild.sbt
File metadata and controls
179 lines (166 loc) · 4.82 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
import Dependencies.*
import ProjectMatrixSyntax.*
import sbt.Keys.*
import sbt.Project.projectToRef
import sbt.internal.ProjectMatrix
lazy val scalaVersions = Seq("2.13.16", "3.3.7")
lazy val commonSettings = Seq(
organization := "com.evolutiongaming",
homepage := Some(url("https://github.com/evolution-gaming/sequentially")),
startYear := Some(2018),
organizationName := "Evolution",
organizationHomepage := Some(url("https://evolution.com")),
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))),
// compiler settings
Compile / scalacOptions ++= {
if (scalaBinaryVersion.value == "2.13") {
Seq(
"-Xsource:3"
)
} else Seq.empty
},
Compile / doc / scalacOptions += "-no-link-warnings",
// publishing and versioning settings
publishTo := Some(Resolver.evolutionReleases),
versionScheme := Some("semver-spec"),
versionPolicyIntention := Compatibility.BinaryCompatible,
)
lazy val root = project
.in(file("."))
.settings(commonSettings)
.settings(
name := "sequentially-root",
publish / skip := true,
// setting the Scala version so this module does not pull scalafix & others for 2.12
scalaVersion := scalaVersions.head,
)
.aggregate(
(sequentially.projectRefs ++
`sequentially-ce`.projectRefs ++
`sequentially-ce-metrics`.projectRefs ++
`sequentially-metrics`.projectRefs :+
projectToRef(benchmark)): _*
)
lazy val sequentially = projectMatrix
.in(file("sequentially"))
.settings(commonSettings)
.settings(
name := "sequentially",
Test / scalacOptions -= "-Xfatal-warnings", // Allow deprecation warnings in tests
)
.settings(
libraryDependencies ++= Seq(
FutureHelper,
Dependencies.catsCore,
Dependencies.CatsEffect.effect,
Dependencies.CatsEffect.laws,
Scalatest % Test,
)
)
.configureMatrix(asAkkaPekkoModule(
akkaDependencies = Seq(
Akka.Stream,
Akka.Testkit % Test,
),
pekkoDependencies = Seq(
Pekko.Stream,
Pekko.Testkit % Test,
AkkaToPekkoAdapter.Actor,
AkkaToPekkoAdapter.Stream,
AkkaToPekkoAdapter.Testkit % Test,
),
))
lazy val `sequentially-ce` = projectMatrix
.in(file("sequentially-ce"))
.settings(commonSettings)
.settings(
name := "sequentially-ce"
)
.settings(
libraryDependencies ++= Seq(
FutureHelper,
Dependencies.catsCore,
Dependencies.CatsEffect.effect,
Dependencies.CatsEffect.laws,
Scalatest % Test,
),
excludeDependencies ++= Seq(
ExclusionRule("com.typesafe.akka"),
ExclusionRule("org.apache.pekko"),
),
)
.jvmPlatform(scalaVersions = scalaVersions)
lazy val `sequentially-ce-metrics` = projectMatrix
.in(file("sequentially-ce-metrics"))
.settings(commonSettings)
.settings(
name := "sequentially-ce-metrics"
)
.settings(
libraryDependencies ++= Seq(
PrometheusTools,
Dependencies.CatsEffect.effect,
Scalatest % Test,
),
excludeDependencies ++= Seq(
ExclusionRule("com.typesafe.akka"),
ExclusionRule("org.apache.pekko"),
),
)
.jvmPlatform(scalaVersions = scalaVersions)
.dependsOn(`sequentially-ce`)
lazy val benchmark = project
.in(file("benchmark"))
.settings(commonSettings)
.enablePlugins(JmhPlugin)
.settings(
name := "benchmark",
publish / skip := true,
scalaVersion := scalaVersions.head,
crossScalaVersions := Seq(scalaVersions.head),
Compile / scalacOptions -= "-Xfatal-warnings", // Allow deprecation warnings for benchmark
)
.dependsOn(
sequentially.finder(ConfigAxis.Provider.akka)(scalaVersions.head),
`sequentially-ce`.finder()(scalaVersions.head),
)
lazy val `sequentially-metrics` = projectMatrix
.in(file("sequentially-metrics"))
.settings(commonSettings)
.settings(name := "sequentially-metrics")
.dependsOn(sequentially)
.settings(
libraryDependencies ++= Seq(
PrometheusTools
)
)
.configureMatrix(asAkkaPekkoModule())
//used by evolution-gaming/scala-github-actions
addCommandAlias(
"check",
"all versionPolicyCheck Compile/doc scalafmtCheckAll scalafmtSbtCheck; scalafixEnable; scalafixAll --check",
)
addCommandAlias("fmtAll", "all scalafmtAll scalafmtSbt; scalafixEnable; scalafixAll")
def asAkkaPekkoModule(
akkaDependencies: Seq[ModuleID] = Seq.empty,
pekkoDependencies: Seq[ModuleID] = Seq.empty,
)(
p: ProjectMatrix
): ProjectMatrix = {
p
.jvmPlatform(
scalaVersions = scalaVersions,
axisValues = Seq(ConfigAxis.Provider.pekko),
configure = _.settings(
moduleName := moduleName.value + "-pekko",
libraryDependencies ++= pekkoDependencies,
),
)
.jvmPlatform(
scalaVersions = scalaVersions,
axisValues = Seq(ConfigAxis.Provider.akka),
configure = _.settings(
libraryDependencies ++= akkaDependencies
),
)
}