-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.sbt
executable file
·178 lines (165 loc) · 5.06 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
lazy val Scala212Version = "2.12.10"
lazy val Scala213Version = "2.13.1"
def scalacVersionOptions(scalaVersion: String) =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, 12)) => Seq("-Ypartial-unification")
case _ => Nil
}
lazy val commonSettings = Seq(
organization := "io.github.howardjohn",
scalaVersion := Scala212Version,
crossScalaVersions := Seq(Scala212Version, Scala213Version),
version := "0.4.0"
)
lazy val root = project
.in(file("."))
.settings(commonSettings)
.settings(noPublishSettings)
.aggregate(common, tests, http4s, http4sZio, akka, exampleHttp4s, exampleAkka)
lazy val CirceVersion = "0.13.0"
lazy val ScalaTestVersion = "3.1.0"
lazy val Http4sVersion = "0.21.3"
lazy val common = project
.in(file("common"))
.settings(commonSettings)
.settings(publishSettings)
.settings(
moduleName := "scala-server-lambda-common",
libraryDependencies ++=
Seq(
"io.circe" %% "circe-generic" % CirceVersion,
"io.circe" %% "circe-parser" % CirceVersion,
"org.scalatest" %% "scalatest" % ScalaTestVersion % "test"
)
)
lazy val tests = project
.in(file("tests"))
.settings(commonSettings)
.settings(publishSettings)
.settings(
moduleName := "scala-server-lambda-tests",
libraryDependencies ++=
Seq(
"org.scalatest" %% "scalatest" % ScalaTestVersion
)
)
.dependsOn(common)
lazy val http4s = project
.in(file("http4s-lambda"))
.settings(publishSettings)
.settings(commonSettings)
.settings(
name := "http4s-lambda",
moduleName := "http4s-lambda",
scalacOptions ++= scalacVersionOptions(scalaVersion.value),
libraryDependencies ++= {
Seq(
"org.http4s" %% "http4s-core" % Http4sVersion,
"org.scalatest" %% "scalatest" % ScalaTestVersion % "test",
"org.http4s" %% "http4s-dsl" % Http4sVersion % "test",
"org.http4s" %% "http4s-circe" % Http4sVersion % "test"
)
}
)
.dependsOn(common)
.dependsOn(tests % "test")
lazy val http4sZio = project
.in(file("http4s-lambda-zio"))
.settings(publishSettings)
.settings(commonSettings)
.settings(
name := "http4s-lambda-zio",
moduleName := "http4s-lambda-zio",
scalacOptions ++= scalacVersionOptions(scalaVersion.value),
libraryDependencies ++= {
Seq(
"org.http4s" %% "http4s-core" % Http4sVersion,
"org.scalatest" %% "scalatest" % ScalaTestVersion % "test",
"org.http4s" %% "http4s-dsl" % Http4sVersion % "test",
"org.http4s" %% "http4s-circe" % Http4sVersion % "test",
"dev.zio" %% "zio" % "1.0.0-RC14",
"dev.zio" %% "zio-interop-cats" % "2.0.0.0-RC5"
)
}
)
.dependsOn(common)
.dependsOn(tests % "test")
.dependsOn(http4s % "test->test;compile->compile")
lazy val akka = project
.in(file("akka-http-lambda"))
.settings(publishSettings)
.settings(commonSettings)
.settings(
name := "akka-http-lambda",
moduleName := "akka-http-lambda",
scalacOptions ++= scalacVersionOptions(scalaVersion.value),
libraryDependencies ++= {
Seq(
"com.typesafe.akka" %% "akka-http" % "10.1.10",
"com.typesafe.akka" %% "akka-stream" % "2.5.26",
"org.scalatest" %% "scalatest" % ScalaTestVersion % "test"
)
}
)
.dependsOn(common)
.dependsOn(tests % "test")
lazy val exampleHttp4s = project
.in(file("example-http4s"))
.settings(noPublishSettings)
.settings(commonSettings)
.settings(
moduleName := "example-http4s",
assemblyJarName in assembly := "example-http4s.jar",
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-dsl" % Http4sVersion
)
)
.dependsOn(http4s)
lazy val exampleAkka = project
.in(file("example-akka-http"))
.settings(noPublishSettings)
.settings(commonSettings)
.settings(
moduleName := "example-akka-http",
assemblyJarName in assembly := "example-akka-http.jar",
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-http" % "10.1.10",
"com.typesafe.akka" %% "akka-stream" % "2.5.26"
)
)
.dependsOn(akka)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val publishSettings = Seq(
homepage := Some(url("https://github.com/howardjohn/scala-server-lambda")),
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
scmInfo := Some(
ScmInfo(
url("https://github.com/howardjohn/scala-server-lambda"),
"scm:[email protected]:howardjohn/scala-server-lambda.git"
)),
developers := List(
Developer(
id = "howardjohn",
name = "John Howard",
email = "[email protected]",
url = url("https://github.com/howardjohn/")
)
),
credentials += Credentials(Path.userHome / ".sbt" / ".credentials"),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
false
},
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
)