forked from zio/zio-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
227 lines (203 loc) · 7.46 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
import BuildHelper._
import InfrastructureHelper._
import explicitdeps.ExplicitDepsPlugin.autoImport.moduleFilterRemoveValue
import sbtcrossproject.CrossPlugin.autoImport.crossProject
inThisBuild(
List(
organization := "dev.zio",
homepage := Some(url("https://zio.github.io/zio-sql/")),
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-sql/"), "scm:git:git@github.com:zio/zio-sql.git")
)
)
)
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")
val zioVersion = "1.0.3"
val testcontainersVersion = "1.15.0"
lazy val startPostgres = taskKey[Unit]("Start up Postgres")
startPostgres := startService(Database.Postgres, streams.value)
lazy val stopPostgres = taskKey[Unit]("Shut down Postgres")
stopPostgres := stopService(Database.Postgres, streams.value)
lazy val startMySQL = taskKey[Unit]("Start up MySQL")
startMySQL := startService(Database.MySQL, streams.value)
lazy val stopMySQL = taskKey[Unit]("Shut down MySQL")
stopMySQL := stopService(Database.MySQL, streams.value)
lazy val startMsSQL = taskKey[Unit]("Start up Microsoft SQL Server")
startMsSQL := startService(Database.MSSQL, streams.value)
lazy val stopMsSQL = taskKey[Unit]("Shut down Microsoft SQL Server")
stopMsSQL := stopService(Database.MSSQL, streams.value)
lazy val startOracle = taskKey[Unit]("Start up Oracle")
startOracle := startService(Database.Oracle, streams.value)
lazy val stopOracle = taskKey[Unit]("Shut down Oracle")
stopOracle := stopService(Database.Oracle, streams.value)
lazy val root = project
.in(file("."))
.settings(
skip in publish := true,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)
.aggregate(
coreJVM,
coreJS,
docs,
driver,
examples,
jdbc,
mysql,
oracle,
postgres,
sqlserver,
test
)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.in(file("core"))
.settings(stdSettings("zio-sql"))
.settings(crossProjectSettings)
.settings(buildInfoSettings("zio.sql"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-streams" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % "test",
"dev.zio" %% "zio-test-sbt" % zioVersion % "test"
)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
lazy val coreJS = core.js
.settings(scalaJSUseMainModuleInitializer := true)
lazy val coreJVM = core.jvm
.settings(dottySettings)
lazy val docs = project
.in(file("zio-sql-docs"))
.settings(
skip.in(publish) := true,
moduleName := "zio-sql-docs",
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion
)
)
.dependsOn(coreJVM)
.enablePlugins(MdocPlugin, DocusaurusPlugin)
lazy val examples = project
.in(file("examples"))
.settings(stdSettings("examples"))
.settings(
skip in publish := true,
moduleName := "examples"
)
.settings(dottySettings)
.dependsOn(sqlserver)
lazy val driver = project
.in(file("driver"))
.settings(stdSettings("zio-sql-driver"))
.settings(buildInfoSettings("zio.sql.driver"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % "test",
"dev.zio" %% "zio-test-sbt" % zioVersion % "test"
)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.settings(dottySettings)
lazy val jdbc = project
.in(file("jdbc"))
.settings(stdSettings("zio-sql-jdbc"))
.settings(buildInfoSettings("zio.sql.jdbc"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-streams" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion,
"dev.zio" %% "zio-test-sbt" % zioVersion % "test"
)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.settings(dottySettings)
.dependsOn(core.jvm)
lazy val mysql = project
.in(file("mysql"))
.settings(stdSettings("zio-sql-mysql"))
.settings(buildInfoSettings("zio.sql.mysql"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % "test",
"dev.zio" %% "zio-test-sbt" % zioVersion % "test"
)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.settings(dottySettings)
.dependsOn(jdbc)
lazy val oracle = project
.in(file("oracle"))
.settings(stdSettings("zio-sql-oracle"))
.settings(buildInfoSettings("zio.sql.oracle"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % "test",
"dev.zio" %% "zio-test-sbt" % zioVersion % "test"
)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.settings(dottySettings)
.dependsOn(jdbc)
lazy val postgres = project
.in(file("postgres"))
.settings(stdSettings("zio-sql-postgres"))
.settings(buildInfoSettings("zio.sql.postgres"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test,
"org.testcontainers" % "testcontainers" % testcontainersVersion % Test,
"org.testcontainers" % "database-commons" % testcontainersVersion % Test,
"org.testcontainers" % "postgresql" % testcontainersVersion % Test,
"org.testcontainers" % "jdbc" % testcontainersVersion % Test,
"org.postgresql" % "postgresql" % "42.2.18" % Test,
"com.dimafeng" %% "testcontainers-scala-postgresql" % "1.0.0-alpha1" % Test
)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.settings(dottySettings)
.dependsOn(jdbc)
lazy val sqlserver = project
.in(file("sqlserver"))
.settings(stdSettings("zio-sql-sqlserver"))
.settings(buildInfoSettings("zio.sql.sqlserver"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % "test",
"dev.zio" %% "zio-test-sbt" % zioVersion % "test"
)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.settings(dottySettings)
.dependsOn(jdbc)
lazy val test = project
.in(file("test"))
.settings(stdSettings("zio-sql-test"))
.settings(buildInfoSettings("zio.sql.test"))
.settings(
skip in publish := true,
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % "test",
"dev.zio" %% "zio-test-sbt" % zioVersion % "test"
)
)
.settings(testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"))
.settings(dottySettings)