forked from zio/zio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
218 lines (197 loc) · 7.57 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
// shadow sbt-scalajs' crossProject from Scala.js 0.6.x
import sbtcrossproject.CrossPlugin.autoImport.crossProject
import Scalaz._
import xerial.sbt.Sonatype._
name := "scalaz-zio"
inThisBuild(
List(
organization := "org.scalaz",
homepage := Some(url("https://scalaz.github.io/scalaz-zio/")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
"jdegoes",
"John De Goes",
url("http://degoes.net")
)
)
)
)
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")
lazy val root = project
.in(file("."))
.settings(
skip in publish := true,
console := (console in Compile in coreJVM).value
)
.aggregate(
coreJVM,
coreJS,
interopSharedJVM,
interopSharedJS,
interopCatsJVM,
interopCatsJS,
interopFutureJVM,
interopFutureJS,
interopScalaz7xJVM,
interopScalaz7xJS,
benchmarks,
microsite
)
.enablePlugins(ScalaJSPlugin)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.in(file("core"))
.settings(stdSettings("zio"))
.settings(
libraryDependencies ++= Seq(
"org.specs2" %%% "specs2-core" % "4.3.4" % Test,
"org.specs2" %%% "specs2-scalacheck" % "4.3.4" % Test,
"org.specs2" %%% "specs2-matcher-extra" % "4.3.4" % Test
),
scalacOptions in Test ++= Seq("-Yrangepos")
)
.enablePlugins(BuildInfoPlugin)
.settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion, isSnapshot),
buildInfoPackage := "scalaz.zio",
buildInfoObject := "BuildInfo"
)
lazy val coreJVM = core.jvm
.configure(_.enablePlugins(JCStressPlugin))
.settings(
// In the repl most warnings are useless or worse.
// This is intentionally := as it's more direct to enumerate the few
// options we do want than to try to subtract off the ones we don't.
// One of -Ydelambdafy:inline or -Yrepl-class-based must be given to
// avoid deadlocking on parallel operations, see
// https://issues.scala-lang.org/browse/SI-9076
scalacOptions in Compile in console := Seq(
"-Ypartial-unification",
"-language:higherKinds",
"-language:existentials",
"-Yno-adapted-args",
"-Xsource:2.13",
"-Yrepl-class-based"
),
initialCommands in Compile in console := """
|import scalaz._
|import scalaz.zio._
|import scalaz.zio.console._
|object replRTS extends RTS {}
|import replRTS._
|implicit class RunSyntax[E, A](io: IO[E, A]){ def unsafeRun: A = replRTS.unsafeRun(io) }
""".stripMargin
)
lazy val coreJS = core.js
lazy val interopShared = crossProject(JSPlatform, JVMPlatform)
.in(file("interop-shared"))
.settings(stdSettings("zio-interop-shared"))
.dependsOn(core % "test->test;compile->compile")
.settings(
scalacOptions in Test ++= Seq("-Yrangepos")
)
lazy val interopSharedJVM = interopShared.jvm
lazy val interopSharedJS = interopShared.js
lazy val interopCats = crossProject(JSPlatform, JVMPlatform)
.in(file("interop-cats"))
.settings(stdSettings("zio-interop-cats"))
.dependsOn(core % "test->test;compile->compile")
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-effect" % "1.0.0" % Optional,
"co.fs2" %%% "fs2-core" % "1.0.0" % Test
),
scalacOptions in Test ++= Seq("-Yrangepos")
)
lazy val interopCatsJVM = interopCats.jvm
.dependsOn(interopSharedJVM)
// Below is for the cats law spec
// Separated due to binary incompatibility in scalacheck 1.13 vs 1.14
// TODO remove it when https://github.com/typelevel/discipline/issues/52 is closed
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-effect-laws" % "1.0.0-1182d8c" % Test,
"org.typelevel" %% "cats-testkit" % "1.3.1" % Test,
"com.github.alexarchambault" %% "scalacheck-shapeless_1.13" % "1.1.8" % Test
),
dependencyOverrides += "org.scalacheck" %% "scalacheck" % "1.13.5" % Test
)
lazy val interopCatsJS = interopCats.js.dependsOn(interopSharedJS)
lazy val interopFuture = crossProject(JSPlatform, JVMPlatform)
.in(file("interop-future"))
.settings(stdSettings("zio-interop-future"))
.dependsOn(core % "test->test;compile->compile")
.settings(
scalacOptions in Test ++= Seq("-Yrangepos")
)
lazy val interopFutureJVM = interopFuture.jvm.dependsOn(interopSharedJVM)
lazy val interopFutureJS = interopFuture.js.dependsOn(interopSharedJS)
lazy val interopScalaz7x = crossProject(JSPlatform, JVMPlatform)
.in(file("interop-scala7x"))
.settings(stdSettings("zio-interop-scala7x"))
.dependsOn(core % "test->test;compile->compile")
.settings(
libraryDependencies ++= Seq(
"org.scalaz" %%% "scalaz-core" % "7.2.+" % Optional,
"org.scalaz" %%% "scalaz-scalacheck-binding" % "7.2.+" % Test
),
scalacOptions in Test ++= Seq("-Yrangepos")
)
lazy val interopScalaz7xJVM = interopScalaz7x.jvm.dependsOn(interopSharedJVM)
lazy val interopScalaz7xJS = interopScalaz7x.js.dependsOn(interopSharedJS)
lazy val benchmarks = project.module
.dependsOn(coreJVM)
.enablePlugins(JmhPlugin)
.settings(
skip in publish := true,
libraryDependencies ++=
Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided,
"io.monix" %% "monix" % "3.0.0-RC1",
"org.typelevel" %% "cats-effect" % "1.0.0",
"co.fs2" %% "fs2-core" % "1.0.0"
)
)
lazy val microsite = project.module
.dependsOn(coreJVM, interopCatsJVM, interopFutureJVM, interopScalaz7xJVM)
.enablePlugins(MicrositesPlugin)
.settings(
scalacOptions -= "-Yno-imports",
scalacOptions ~= { _ filterNot (_ startsWith "-Ywarn") },
scalacOptions ~= { _ filterNot (_ startsWith "-Xlint") },
skip in publish := true,
libraryDependencies ++= Seq(
"com.github.ghik" %% "silencer-lib" % "1.0",
"commons-io" % "commons-io" % "2.6"
),
micrositeFooterText := Some(
"""
|<p>© 2018 <a href="https://github.com/scalaz/scalaz-zio">ZIO Maintainers</a></p>
|""".stripMargin
),
micrositeName := "",
micrositeDescription := "Type-safe, composable concurrency for Scala",
micrositeAuthor := "ZIO contributors",
micrositeOrganizationHomepage := "https://github.com/scalaz/scalaz-zio",
micrositeGitterChannelUrl := "scalaz/scalaz-zio",
micrositeGitHostingUrl := "https://github.com/scalaz/scalaz-zio",
micrositeGithubOwner := "scalaz",
micrositeGithubRepo := "scalaz-zio",
micrositeFavicons := Seq(microsites.MicrositeFavicon("favicon.png", "512x512")),
micrositeDocumentationUrl := s"https://javadoc.io/doc/org.scalaz/scalaz-zio_2.12/${(version in Compile).value}",
micrositeDocumentationLabelDescription := "Scaladoc",
micrositeBaseUrl := "/scalaz-zio",
micrositePalette := Map(
"brand-primary" -> "#ED2124",
"brand-secondary" -> "#251605",
"brand-tertiary" -> "#491119",
"gray-dark" -> "#453E46",
"gray" -> "#837F84",
"gray-light" -> "#E3E2E3",
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#FFFFFF"
)
)