-
Notifications
You must be signed in to change notification settings - Fork 67
/
build.sbt
165 lines (148 loc) · 6.5 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
import BuildHelper._
import explicitdeps.ExplicitDepsPlugin.autoImport.moduleFilterRemoveValue
import sbtcrossproject.CrossPlugin.autoImport.crossProject
name := "interop-cats"
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",
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("check", "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(
zioInteropCatsJVM,
zioInteropCatsJS,
zioInteropCatsTestsJVM,
zioInteropCatsTestsJS,
zioTestInteropCatsJVM,
zioTestInteropCatsJS
)
.settings(
publish / skip := true,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)
val zioVersion = "1.0.18"
val catsVersion = "2.6.1"
val catsEffectVersion = "3.2.9"
val catsMtlVersion = "1.2.1"
val disciplineScalaTestVersion = "2.2.0"
val fs2Version = "3.1.6"
val scalaJavaTimeVersion = "2.3.0"
lazy val zioInteropCats = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-interop-cats"))
.enablePlugins(BuildInfoPlugin)
.settings(stdSettings("zio-interop-cats"))
.settings(buildInfoSettings)
.settings(
libraryDependencies ++= {
val optLibraries0 = List(
"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
}
)
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(
libraryDependencies ++= {
val optLibraries0 = List(
"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(publish / skip := true)
.settings(
libraryDependencies ++= {
val optLibraries0 = List(
"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) :: 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(publish / skip := true)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % catsVersion,
"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)