-
Notifications
You must be signed in to change notification settings - Fork 180
/
build.sbt
212 lines (191 loc) · 7.62 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
val scala212 = "2.12.19"
val scala213 = "2.13.14"
val scala3 = "3.3.1"
lazy val commonSettings = Seq(
organizationName := "slick-pg",
organization := "com.github.tminglei",
name := "slick-pg",
version := "0.22.2",
scalaVersion := scala213,
crossScalaVersions := Seq(scala212, scala213, scala3),
scalacOptions ++= Seq("-deprecation", "-feature",
"-language:implicitConversions",
"-language:reflectiveCalls",
"-language:higherKinds",
"-language:postfixOps",
"-language:existentials"),
fork := true,
javaOptions ++= Seq("-XX:MaxMetaspaceSize=512m"),
resolvers += Resolver.mavenLocal,
resolvers ++= Resolver.sonatypeOssRepos("snapshots"),
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/",
// publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository"))),
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishMavenStyle := true,
(Test / publishArtifact) := false,
pomIncludeRepository := { _ => false },
makePomConfiguration := makePomConfiguration.value.withConfigurations(
configurations = Vector(Compile, Runtime, Optional)
),
pomExtra :=
<url>https://github.com/tminglei/slick-pg</url>
<licenses>
<license>
<name>BSD-style</name>
<url>http://www.opensource.org/licenses/bsd-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:tminglei/slick-pg.git</url>
<connection>scm:git:git@github.com:tminglei/slick-pg.git</connection>
</scm>
<developers>
<developer>
<id>tminglei</id>
<name>Minglei Tu</name>
<timezone>+8</timezone>
</developer>
</developers>
)
def mainDependencies(scalaVersion: String) = {
val isScala3 = scalaVersion.startsWith("3")
Seq (
"org.scala-lang.modules" %% "scala-parser-combinators" % (if (isScala3) "2.3.0" else "1.1.2"),
"dev.zio" %% "izumi-reflect" % "2.3.10",
"com.typesafe.slick" %% "slick" % "3.5.1",
"org.postgresql" % "postgresql" % "42.7.3",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0",
"org.slf4j" % "slf4j-simple" % "2.0.13" % "provided",
"org.scalatest" %% "scalatest" % "3.2.19" % "test",
"com.dimafeng" %% "testcontainers-scala-scalatest" % "0.41.3" % "test",
"com.dimafeng" %% "testcontainers-scala-postgresql" % "0.41.3" % "test"
) ++ (if (isScala3) Nil else Seq("org.scala-lang" % "scala-reflect" % scalaVersion))
}
lazy val slickPgCore = (project in file("./core"))
.settings(commonSettings)
.settings(
name := "slick-pg_core",
description := "Slick extensions for PostgreSQL - Core",
libraryDependencies := mainDependencies(scalaVersion.value)
)
lazy val slickPg = (project in file("."))
.settings(commonSettings)
.settings(
name := "slick-pg",
description := "Slick extensions for PostgreSQL",
libraryDependencies := mainDependencies(scalaVersion.value)
)
.dependsOn (slickPgCore % "test->test;compile->compile")
.aggregate (slickPgCore, slickPgJoda, slickPgJson4s, slickPgJts, slickPgJtsLt, slickPgPlayJson, slickPgSprayJson, slickPgCirceJson, slickPgArgonaut, slickPgJawn)
lazy val slickPgJoda = (project in file("./addons/joda-time"))
.settings(commonSettings)
.settings(
name := "slick-pg_joda-time",
description := "Slick extensions for PostgreSQL - joda time module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"joda-time" % "joda-time" % "2.12.7"
)
)
.dependsOn (slickPgCore % "test->test;compile->compile")
lazy val slickPgJson4s = (project in file("./addons/json4s"))
.settings(commonSettings)
.settings(
name := "slick-pg_json4s",
description := "Slick extensions for PostgreSQL - json4s module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"org.json4s" %% "json4s-ast" % "4.0.7",
"org.json4s" %% "json4s-core" % "4.0.7",
"org.json4s" %% "json4s-native" % "4.0.7" % "test"
)
)
.dependsOn (slickPgCore % "test->test;compile->compile")
lazy val slickPgJts = (project in file("./addons/jts"))
.settings(commonSettings)
.settings(
name := "slick-pg_jts",
description := "Slick extensions for PostgreSQL - jts module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"com.vividsolutions" % "jts-core" % "1.14.0"
)
)
.dependsOn (slickPgCore % "test->test;compile->compile")
lazy val slickPgJtsLt = (project in file("./addons/jts_lt"))
.settings(commonSettings)
.settings(
name := "slick-pg_jts_lt",
description := "Slick extensions for PostgreSQL - (locationtech) jts module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"org.locationtech.jts" % "jts-core" % "1.19.0"
)
)
.dependsOn (slickPgCore % "test->test;compile->compile")
def playJsonDependencies(scalaVersion: String) = {
if (scalaVersion.startsWith("3")) Seq("org.playframework" %% "play-json" % "3.0.3")
else Seq("com.typesafe.play" %% "play-json" % "2.10.6")
}
lazy val slickPgPlayJson = (project in file("./addons/play-json"))
.settings(commonSettings)
.settings(
name := "slick-pg_play-json",
description := "Slick extensions for PostgreSQL - play-json module",
libraryDependencies := mainDependencies(scalaVersion.value) ++
playJsonDependencies(scalaVersion.value)
)
.dependsOn (slickPgCore % "test->test;compile->compile")
lazy val slickPgSprayJson = (project in file("./addons/spray-json"))
.settings(commonSettings)
.settings(
name := "slick-pg_spray-json",
description := "Slick extensions for PostgreSQL - spray-json module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"io.spray" %% "spray-json" % "1.3.6"
)
)
.dependsOn (slickPgCore % "test->test;compile->compile")
lazy val slickPgCirceJson = (project in file("./addons/circe-json"))
.settings(commonSettings)
.settings(
name := "slick-pg_circe-json",
description := "Slick extensions for PostgreSQL - circe module",
libraryDependencies := mainDependencies(scalaVersion.value) ++
Seq(
"io.circe" %% "circe-core" % "0.14.9",
"io.circe" %% "circe-generic" % "0.14.9",
"io.circe" %% "circe-parser" % "0.14.9"
)
)
.dependsOn (slickPgCore % "test->test;compile->compile")
lazy val slickPgUPickleJson = (project in file("./addons/upickle-json"))
.settings(commonSettings)
.settings(
name := "slick-pg_upickle-json",
description := "Slick extensions for PostgreSQL - uPickle module",
libraryDependencies := mainDependencies(scalaVersion.value) ++
Seq("com.lihaoyi" %% "ujson" % "3.1.4")
)
.dependsOn(slickPgCore % "test->test;compile->compile")
lazy val slickPgArgonaut = (project in file("./addons/argonaut"))
.settings(commonSettings)
.settings(
name := "slick-pg_argonaut",
description := "Slick extensions for PostgreSQL - argonaut module",
libraryDependencies := mainDependencies(scalaVersion.value) ++
Seq("io.argonaut" %% "argonaut" % "6.3.10")
)
.dependsOn (slickPgCore % "test->test;compile->compile")
lazy val slickPgJawn = (project in file("./addons/jawn"))
.settings(commonSettings)
.settings(
name := "slick-pg_jawn",
description := "Slick extensions for PostgreSQL - jawn module",
libraryDependencies := mainDependencies(scalaVersion.value) ++
Seq("org.typelevel" %% "jawn-ast" % "1.6.0")
)
.dependsOn (slickPgCore % "test->test;compile->compile")