-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
295 lines (267 loc) · 9.96 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
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
// shadow sbt-scalajs' crossProject from Scala.js 0.6.x
import BuildHelper._
import explicitdeps.ExplicitDepsPlugin.autoImport.moduleFilterRemoveValue
import sbtcrossproject.CrossPlugin.autoImport.crossProject
name := "zio"
inThisBuild(
List(
organization := "dev.zio",
homepage := Some(url("https://zio.dev")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
"jdegoes",
"John De Goes",
"john@degoes.net",
url("http://degoes.net")
)
),
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc"),
scmInfo := Some(
ScmInfo(url("https://github.com/zio/zio/"), "scm:git:git@github.com:zio/zio.git")
)
)
)
ThisBuild / publishTo := sonatypePublishToBundle.value
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")
addCommandAlias("compileJVM", ";coreJVM/test:compile;stacktracerJVM/test:compile")
addCommandAlias(
"testJVM",
";coreTestsJVM/test;stacktracerJVM/test;streamsTestsJVM/test;testTestsJVM/run;testTestsJVM/test;testRunnerJVM/test:run;examplesJVM/test:compile"
)
addCommandAlias(
"testJS",
";coreTestsJS/test;stacktracerJS/test;streamsTestsJS/test;testTestsJS/run;testTestsJS/test;examplesJS/test:compile"
)
lazy val root = project
.in(file("."))
.settings(
skip in publish := true,
console := (console in Compile in coreJVM).value,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)
.aggregate(
coreJVM,
coreJS,
coreTestsJVM,
coreTestsJS,
docs,
streamsJVM,
streamsJS,
streamsTestsJVM,
streamsTestsJS,
benchmarks,
testJVM,
testJS,
testTestsJVM,
testTestsJS,
stacktracerJS,
stacktracerJVM,
testRunnerJS,
testRunnerJVM
)
.enablePlugins(ScalaJSPlugin)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.in(file("core"))
.dependsOn(stacktracer)
.settings(stdSettings("zio"))
.settings(buildInfoSettings("zio"))
.enablePlugins(BuildInfoPlugin)
lazy val coreJVM = core.jvm
.settings(dottySettings)
.settings(replSettings)
lazy val coreJS = core.js
lazy val coreTests = crossProject(JSPlatform, JVMPlatform)
.in(file("core-tests"))
.dependsOn(core)
.dependsOn(test)
.settings(stdSettings("core-tests"))
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.dependsOn(testRunner)
.settings(buildInfoSettings("zio"))
.settings(skip in publish := true)
.settings(Compile / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat)
.settings(
libraryDependencies ++= Seq(
"org.specs2" %%% "specs2-core" % "4.7.1" % Test,
"org.specs2" %%% "specs2-scalacheck" % "4.7.1" % Test,
"org.specs2" %%% "specs2-matcher-extra" % "4.7.1" % Test
)
)
.enablePlugins(BuildInfoPlugin)
lazy val coreTestsJVM = coreTests.jvm
.configure(_.enablePlugins(JCStressPlugin))
.settings(replSettings)
lazy val coreTestsJS = coreTests.js
.settings(
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC3" % Test
)
lazy val streams = crossProject(JSPlatform, JVMPlatform)
.in(file("streams"))
.dependsOn(core)
.settings(stdSettings("zio-streams"))
.settings(buildInfoSettings("zio.stream"))
.settings(streamReplSettings)
.enablePlugins(BuildInfoPlugin)
lazy val streamsJVM = streams.jvm
lazy val streamsJS = streams.js
lazy val streamsTests = crossProject(JSPlatform, JVMPlatform)
.in(file("streams-tests"))
.dependsOn(streams)
.dependsOn(coreTests % "test->test;compile->compile")
.settings(stdSettings("core-tests"))
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.dependsOn(testRunner)
.settings(buildInfoSettings("zio.stream"))
.settings(skip in publish := true)
.settings(
libraryDependencies ++= Seq(
"org.specs2" %%% "specs2-core" % "4.7.1" % Test,
"org.specs2" %%% "specs2-scalacheck" % "4.7.1" % Test,
"org.specs2" %%% "specs2-matcher-extra" % "4.7.1" % Test
)
)
.enablePlugins(BuildInfoPlugin)
lazy val streamsTestsJVM = streamsTests.jvm.dependsOn(coreTestsJVM % "test->compile")
lazy val streamsTestsJS = streamsTests.js
lazy val test = crossProject(JSPlatform, JVMPlatform)
.in(file("test"))
.dependsOn(core, streams)
.settings(stdSettings("zio-test"))
.settings(
libraryDependencies ++= Seq(
"org.portable-scala" %%% "portable-scala-reflect" % "0.1.0"
)
)
lazy val testJVM = test.jvm
lazy val testJS = test.js
lazy val testTests = crossProject(JSPlatform, JVMPlatform)
.in(file("test-tests"))
.dependsOn(test)
.settings(stdSettings("test-tests"))
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.dependsOn(testRunner)
.settings(buildInfoSettings("zio.test"))
.settings(skip in publish := true)
.enablePlugins(BuildInfoPlugin)
lazy val testTestsJVM = testTests.jvm.settings(
mainClass in Compile := Some("zio.test.TestMain")
)
lazy val testTestsJS = testTests.js.settings(
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.0.0-RC3",
scalaJSUseMainModuleInitializer in Compile := true,
mainClass in Compile := Some("zio.test.TestMain")
)
lazy val stacktracer = crossProject(JSPlatform, JVMPlatform)
.in(file("stacktracer"))
.settings(stdSettings("zio-stacktracer"))
.settings(buildInfoSettings("zio.internal.stacktracer"))
.settings(
libraryDependencies ++= Seq(
"org.specs2" %%% "specs2-core" % "4.7.1" % Test,
"org.specs2" %%% "specs2-scalacheck" % "4.7.1" % Test,
"org.specs2" %%% "specs2-matcher-extra" % "4.7.1" % Test
)
)
lazy val stacktracerJS = stacktracer.js
lazy val stacktracerJVM = stacktracer.jvm
.settings(dottySettings)
.settings(replSettings)
lazy val testRunner = crossProject(JVMPlatform, JSPlatform)
.in(file("test-sbt"))
.settings(stdSettings("zio-test-sbt"))
.settings(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.portable-scala" %%% "portable-scala-reflect" % "0.1.0"
),
mainClass in (Test, run) := Some("zio.test.sbt.TestMain")
)
.jsSettings(libraryDependencies ++= Seq("org.scala-js" %% "scalajs-test-interface" % "0.6.29"))
.jvmSettings(libraryDependencies ++= Seq("org.scala-sbt" % "test-interface" % "1.0"))
.dependsOn(core)
.dependsOn(test)
lazy val testRunnerJVM = testRunner.jvm
lazy val testRunnerJS = testRunner.js
/**
* Examples sub-project that is not included in the root project.
* To run tests :
* `sbt "examplesJVM/test"`
*/
lazy val examples = crossProject(JVMPlatform, JSPlatform)
.in(file("examples"))
.settings(stdSettings("examples"))
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.dependsOn(testRunner)
lazy val examplesJS = examples.js
lazy val examplesJVM = examples.jvm
lazy val benchmarks = project.module
.dependsOn(coreJVM, streamsJVM)
.enablePlugins(JmhPlugin)
.settings(replSettings)
.settings(
// skip 2.13 benchmarks until twitter-util publishes for 2.13
crossScalaVersions -= "2.13.0",
//
skip in publish := true,
libraryDependencies ++=
Seq(
"co.fs2" %% "fs2-core" % "2.0.1",
"com.google.code.findbugs" % "jsr305" % "3.0.2",
"com.twitter" %% "util-collection" % "19.1.0",
"com.typesafe.akka" %% "akka-stream" % "2.5.25",
"io.monix" %% "monix" % "3.0.0",
"io.projectreactor" % "reactor-core" % "3.3.0.RELEASE",
"io.reactivex.rxjava2" % "rxjava" % "2.2.13",
"org.ow2.asm" % "asm" % "7.2",
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided,
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.typelevel" %% "cats-effect" % "2.0.0"
),
unusedCompileDependenciesFilter -= libraryDependencies.value
.map(moduleid => moduleFilter(organization = moduleid.organization, name = moduleid.name))
.reduce(_ | _),
scalacOptions in Compile in console := Seq(
"-Ypartial-unification",
"-language:higherKinds",
"-language:existentials",
"-Yno-adapted-args",
"-Xsource:2.13",
"-Yrepl-class-based"
)
)
lazy val docs = project.module
.in(file("zio-docs"))
.settings(
// skip 2.13 mdoc until mdoc is available for 2.13
crossScalaVersions -= "2.13.0",
//
skip.in(publish) := true,
moduleName := "zio-docs",
unusedCompileDependenciesFilter -= moduleFilter("org.scalameta", "mdoc"),
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
scalacOptions ~= { _ filterNot (_ startsWith "-Ywarn") },
scalacOptions ~= { _ filterNot (_ startsWith "-Xlint") },
libraryDependencies ++= Seq(
"com.github.ghik" %% "silencer-lib" % "1.4.2" % "provided",
"commons-io" % "commons-io" % "2.6" % "provided",
"org.jsoup" % "jsoup" % "1.12.1" % "provided",
"org.reactivestreams" % "reactive-streams-examples" % "1.0.3" % "provided",
"dev.zio" %% "zio-interop-cats" % "2.0.0.0-RC4",
"dev.zio" %% "zio-interop-future" % "2.12.8.0-RC3",
"dev.zio" %% "zio-interop-monix" % "3.0.0.0-RC6",
"dev.zio" %% "zio-interop-scalaz7x" % "7.2.27.0-RC1",
"dev.zio" %% "zio-interop-java" % "1.1.0.0-RC5",
"dev.zio" %% "zio-interop-reactivestreams" % "1.0.3.2-RC1",
"dev.zio" %% "zio-interop-twitter" % "19.7.0.0-RC1"
)
)
.dependsOn(
coreJVM,
streamsJVM
)
.enablePlugins(MdocPlugin, DocusaurusPlugin)