forked from tminglei/slick-pg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
188 lines (168 loc) · 7.15 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
lazy val commonSettings = Seq(
organizationName := "slick-pg",
organization := "com.github.tminglei",
name := "slick-pg",
version := "0.17.2",
scalaVersion := "2.12.8",
crossScalaVersions := Seq("2.12.8", "2.11.12"),
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.sonatypeRepo("snapshots"),
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
resolvers += "spray" at "http://repo.spray.io/",
// 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,
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
makePomConfiguration ~= { _.copy(configurations = Some(Seq(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>[email protected]:tminglei/slick-pg.git</url>
<connection>scm:git:[email protected]: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 extractedLibs = CrossVersion.partialVersion(scalaVersion) match {
case Some((2, scalaMajor)) if scalaMajor >= 11 =>
Seq("org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.0" % "provided")
case _ =>
Seq()
}
Seq (
"org.scala-lang" % "scala-reflect" % scalaVersion,
"com.typesafe.slick" %% "slick" % "3.3.0",
"org.postgresql" % "postgresql" % "42.2.5",
"org.slf4j" % "slf4j-simple" % "1.7.24" % "provided",
"org.scalatest" %% "scalatest" % "3.0.5" % "test"
) ++ extractedLibs
}
lazy val slickPgCore = Project(id = "slick-pg_core", base = file("./core"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg_core",
description := "Slick extensions for PostgreSQL - Core",
libraryDependencies := mainDependencies(scalaVersion.value)
)
)
lazy val slickPgProject = Project(id = "slick-pg", base = file("."),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg",
description := "Slick extensions for PostgreSQL",
libraryDependencies := mainDependencies(scalaVersion.value)
)
).dependsOn (slickPgCore)
.aggregate (slickPgCore, slickPgJoda, slickPgJson4s, slickPgJts, slickPgJtsLt, slickPgPlayJson, slickPgSprayJson, slickPgCirceJson, slickPgArgonaut, slickPgJawn)
lazy val slickPgJoda = Project(id = "slick-pg_joda-time", base = file("./addons/joda-time"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg_joda-time",
description := "Slick extensions for PostgreSQL - joda time module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"joda-time" % "joda-time" % "2.10.1",
"org.joda" % "joda-convert" % "2.1.2"
)
)
) dependsOn (slickPgCore)
lazy val slickPgJson4s = Project(id = "slick-pg_json4s", base = file("./addons/json4s"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg_json4s",
description := "Slick extensions for PostgreSQL - json4s module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"org.json4s" %% "json4s-ast" % "3.6.3",
"org.json4s" %% "json4s-core" % "3.6.3",
"org.json4s" %% "json4s-native" % "3.6.3" % "test"
)
)
) dependsOn (slickPgCore)
lazy val slickPgJts = Project(id = "slick-pg_jts", base = file("./addons/jts"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
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)
lazy val slickPgJtsLt = Project(id = "slick-pg_jts_lt", base = file("./addons/jts_lt"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg_jts_lt",
description := "Slick extensions for PostgreSQL - (locationtech) jts module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"org.locationtech.jts" % "jts-core" % "1.16.0"
)
)
) dependsOn (slickPgCore)
lazy val slickPgPlayJson = Project(id = "slick-pg_play-json", base = file("./addons/play-json"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg_play-json",
description := "Slick extensions for PostgreSQL - play-json module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"com.typesafe.play" %% "play-json" % "2.7.3"
)
)
) dependsOn (slickPgCore)
lazy val slickPgSprayJson = Project(id = "slick-pg_spray-json", base = file("./addons/spray-json"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg_spray-json",
description := "Slick extensions for PostgreSQL - spray-json module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"io.spray" %% "spray-json" % "1.3.5"
)
)
) dependsOn (slickPgCore)
lazy val slickPgCirceJson = Project(id = "slick-pg_circe-json", base = file("./addons/circe-json"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg_circe-json",
description := "Slick extensions for PostgreSQL - circe module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"io.circe" %% "circe-core" % "0.11.0",
"io.circe" %% "circe-generic" % "0.11.0",
"io.circe" %% "circe-parser" % "0.11.0"
)
)
) dependsOn (slickPgCore)
lazy val slickPgArgonaut = Project(id = "slick-pg_argonaut", base = file("./addons/argonaut"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg_argonaut",
description := "Slick extensions for PostgreSQL - argonaut module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"io.argonaut" %% "argonaut" % "6.2.2"
)
)
) dependsOn (slickPgCore)
lazy val slickPgJawn = Project(id = "slick-pg_jawn", base = file("./addons/jawn"),
settings = Defaults.coreDefaultSettings ++ commonSettings ++ Seq(
name := "slick-pg_jawn",
description := "Slick extensions for PostgreSQL - jawn module",
libraryDependencies := mainDependencies(scalaVersion.value) ++ Seq(
"org.spire-math" %% "jawn-ast" % "0.13.0"
)
)
) dependsOn (slickPgCore)