-
Notifications
You must be signed in to change notification settings - Fork 67
/
build.sbt
204 lines (184 loc) · 7.92 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
import BuildHelper._
import explicitdeps.ExplicitDepsPlugin.autoImport.moduleFilterRemoveValue
import sbtcrossproject.CrossPlugin.autoImport.crossProject
name := "interop-cats"
inThisBuild(
List(
name := "interop-cats",
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",
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/interop-cats/"), "scm:git:[email protected]:zio/interop-cats.git")
)
)
)
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("lint", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")
addCommandAlias("testJVM", ";zioInteropCatsTestsJVM/test;zioTestInteropCatsJVM/test;coreOnlyTestJVM/test")
addCommandAlias("testJS", ";zioInteropCatsTestsJS/test;zioTestInteropCatsJS/test;coreOnlyTestJS/test")
lazy val root = project
.in(file("."))
.enablePlugins(ScalaJSPlugin)
.aggregate(
zioInteropTracerJVM,
zioInteropTracerJS,
zioInteropCatsJVM,
zioInteropCatsJS,
zioInteropCatsTestsJVM,
zioInteropCatsTestsJS,
zioTestInteropCatsJVM,
zioTestInteropCatsJS,
docs
)
.settings(
publish / skip := true,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)
val zioVersion = "2.1.7"
val catsVersion = "2.10.0"
val catsEffectVersion = "3.5.4"
val catsMtlVersion = "1.4.0"
val disciplineScalaTestVersion = "2.2.0"
val fs2Version = "3.10.2"
val scalaJavaTimeVersion = "2.5.0"
lazy val zioInteropTracer = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-interop-tracer"))
.enablePlugins(BuildInfoPlugin)
.settings(stdSettings("zio-interop-tracer"))
.settings(dottySettings)
.settings(buildInfoSettingsInteropTracer)
.settings(
libraryDependencies ++= Seq(
"dev.zio" %%% "zio-stacktracer" % zioVersion
)
)
lazy val zioInteropTracerJVM = zioInteropTracer.jvm
lazy val zioInteropTracerJS = zioInteropTracer.js
lazy val zioInteropCats = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-interop-cats"))
.dependsOn(zioInteropTracer)
.enablePlugins(BuildInfoPlugin)
.settings(stdSettings("zio-interop-cats"))
.settings(buildInfoSettings)
.settings(dottySettings)
.settings(
libraryDependencies ++= {
val optLibraries0 = List(
"dev.zio" %%% "zio-managed" % zioVersion,
"dev.zio" %%% "zio-streams" % zioVersion,
"org.typelevel" %%% "cats-effect-std" % catsEffectVersion,
"org.typelevel" %%% "cats-mtl" % catsMtlVersion,
"co.fs2" %%% "fs2-core" % fs2Version,
"co.fs2" %%% "fs2-io" % fs2Version
)
val optLibraries = if (scalaVersion.value.startsWith("3")) optLibraries0 else optLibraries0.map(_ % Optional)
("dev.zio" %%% "zio" % zioVersion) :: optLibraries
}
)
lazy val zioInteropCatsJVM = zioInteropCats.jvm
lazy val zioInteropCatsJS = zioInteropCats.js
.settings(libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion % Test)
lazy val zioInteropCatsTests = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-interop-cats-tests"))
.dependsOn(zioTestInteropCats % "test->test;compile->compile")
.enablePlugins(BuildInfoPlugin)
.settings(stdSettings("zio-interop-cats-tests"))
.settings(buildInfoSettings)
.settings(dottySettings)
.settings(
libraryDependencies ++= {
val optLibraries0 = List(
"dev.zio" %%% "zio-managed" % zioVersion,
"dev.zio" %%% "zio-streams" % zioVersion,
"org.typelevel" %%% "cats-effect-std" % catsEffectVersion,
"org.typelevel" %%% "cats-mtl" % catsMtlVersion,
"co.fs2" %%% "fs2-core" % fs2Version
)
val optLibraries = if (scalaVersion.value.startsWith("3")) optLibraries0 else optLibraries0.map(_ % Optional)
("dev.zio" %%% "zio" % zioVersion) :: optLibraries
},
libraryDependencies ++= Seq(
"dev.zio" %%% "zio-test-sbt" % zioVersion,
"org.typelevel" %%% "cats-testkit" % catsVersion,
"org.typelevel" %%% "cats-effect-laws" % catsEffectVersion,
"org.typelevel" %%% "cats-effect-testkit" % catsEffectVersion,
"org.typelevel" %%% "cats-mtl-laws" % catsMtlVersion,
"org.typelevel" %%% "discipline-scalatest" % disciplineScalaTestVersion
).map(_ % Test)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
lazy val zioInteropCatsTestsJVM = zioInteropCatsTests.jvm
lazy val zioInteropCatsTestsJS = zioInteropCatsTests.js
.settings(libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion % Test)
lazy val zioTestInteropCats = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-test-interop-cats"))
.dependsOn(zioInteropCats)
.enablePlugins(BuildInfoPlugin)
.settings(stdSettings("zio-test-interop-cats"))
.settings(buildInfoSettings)
.settings(dottySettings)
.settings(publish / skip := true)
.settings(
libraryDependencies ++= {
val optLibraries0 = List(
"dev.zio" %%% "zio-managed" % zioVersion,
"dev.zio" %%% "zio-streams" % zioVersion,
"dev.zio" %%% "zio-test" % zioVersion,
"org.typelevel" %%% "cats-effect-std" % catsEffectVersion,
"org.typelevel" %%% "cats-mtl" % catsMtlVersion,
"co.fs2" %%% "fs2-core" % fs2Version
)
val optLibraries = if (scalaVersion.value.startsWith("3")) optLibraries0 else optLibraries0.map(_ % Optional)
("dev.zio" %%% "zio" % zioVersion) :: ("org.typelevel" %%% "cats-core" % catsVersion) :: optLibraries
},
libraryDependencies ++= Seq(
"dev.zio" %%% "zio-test-sbt" % zioVersion,
"org.typelevel" %%% "cats-testkit" % catsVersion,
"org.typelevel" %%% "cats-effect-laws" % catsEffectVersion,
"org.typelevel" %%% "cats-effect-testkit" % catsEffectVersion,
"org.typelevel" %%% "cats-mtl-laws" % catsMtlVersion,
"org.typelevel" %%% "discipline-scalatest" % disciplineScalaTestVersion
).map(_ % Test)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
lazy val zioTestInteropCatsJVM = zioTestInteropCats.jvm
lazy val zioTestInteropCatsJS = zioTestInteropCats.js
.settings(libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion % Test)
lazy val coreOnlyTest = crossProject(JSPlatform, JVMPlatform)
.in(file("core-only-test"))
.dependsOn(zioInteropCats)
.settings(stdSettings("core-only-test"))
.settings(dottySettings)
.settings(publish / skip := true)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % catsVersion,
"dev.zio" %%% "zio-managed" % zioVersion,
"dev.zio" %%% "zio-test-sbt" % zioVersion
).map(_ % Test)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
lazy val coreOnlyTestJVM = coreOnlyTest.jvm
lazy val coreOnlyTestJS = coreOnlyTest.js
.settings(libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion % Test)
lazy val docs = project
.in(file("zio-interop-cats-docs"))
.settings(
projectName := "ZIO Interop Cats",
mainModuleName := (zioInteropCatsJVM / moduleName).value,
projectStage := ProjectStage.ProductionReady,
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects()
)
.enablePlugins(WebsitePlugin)