-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.sbt
220 lines (189 loc) · 7.38 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
import sbt.Keys.{credentials, publishMavenStyle}
import ReleaseTransformations._
import sbt.{Credentials, url}
import sbtrelease.Version.Bump.Bugfix
import xerial.sbt.Sonatype.GitHubHosting
val baseScalaOpts = Seq(
"-Ywarn-unused:implicits",
"-Ywarn-unused:imports",
"-Ywarn-unused:locals",
"-Ywarn-unused:params",
"-Ywarn-unused:patvars",
"-Ywarn-unused:privates",
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xlint",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard"
)
val scalac213Opts = baseScalaOpts
val scalac212Opts = baseScalaOpts ++ Seq("-Ypartial-unification")
lazy val global = {
Seq(
scalaVersion := "2.13.10",
organization := "com.fullfacing",
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 => scalac212Opts
case _ => scalac213Opts
}),
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full),
credentials += Credentials("GnuPG Key ID", "gpg", "B45D4204DBB121424926CFA6DBC0CB15C9B7283D", "ignored"),
Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.ScalaLibrary,
crossScalaVersions := Seq(scalaVersion.value, "2.12.17"),
// Your profile name of the sonatype account. The default is the same with the organization value
sonatypeProfileName := "com.fullfacing",
publishTo := sonatypePublishToBundle.value,
publishConfiguration := publishConfiguration.value.withOverwrite(true),
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true),
// To sync with Maven central, you need to supply the following information:
publishMavenStyle := true,
// MIT Licence
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
// Github Project Information
// Developer Contact Information
developers := List(
Developer(
id = "Executioner1939",
name = "Richard Peters",
email = "[email protected]",
url = url("https://www.fullfacing.com/")
),
Developer(
id = "lmuller90",
name = "Louis Muller",
email = "[email protected]",
url = url("https://www.fullfacing.com/")
),
Developer(
id = "StuartJ45",
name = "Stuart Jameson",
email = "[email protected]",
url = url("https://www.fullfacing.com/")
),
Developer(
id = "neil-fladderak",
name = "Neil Fladderak",
email = "[email protected]",
url = url("https://www.fullfacing.com/")
)
),
releaseCommitMessage := s"[skip ci] Setting version to ${(ThisBuild / version).value}",
releaseNextCommitMessage := s"[skip ci] Setting version to ${(ThisBuild / version).value}",
releaseIgnoreUntrackedFiles := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseCrossBuild := true,
releaseVersionBump := Bugfix,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
setReleaseVersion,
pushChanges,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease")
)
)
}
// ---------------------------------- //
// Library Versions //
// ---------------------------------- //
val akkaHttpVersion = "10.5.0"
val akkaStreamsVersion = "2.7.0"
val catsEffectVersion = "3.4.8"
val catsCoreVersion = "2.9.0"
val enumeratumVersion = "1.7.2"
val json4sVersion = "4.0.6"
val logbackVersion = "1.4.5"
val nimbusVersion = "9.30.2"
val scalaTestVersion = "3.2.15"
val sttpVersion = "3.8.13"
// -------------------------------------- //
// Library Dependencies //
// -------------------------------------- //
val akkaHttp: Seq[ModuleID] = Seq(
"com.typesafe.akka" %% "akka-stream" % akkaStreamsVersion,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion
)
val akkaTestKit: Seq[ModuleID] = Seq(
"com.typesafe.akka" %% "akka-stream-testkit" % akkaStreamsVersion,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion
)
val cats: Seq[ModuleID] = Seq(
"org.typelevel" %% "cats-core" % catsCoreVersion,
"org.typelevel" %% "cats-effect" % catsEffectVersion
)
val enumeratum: Seq[ModuleID] = Seq(
"com.beachape" %% "enumeratum-json4s" % enumeratumVersion
)
val json4s: Seq[ModuleID] = Seq(
"org.json4s" %% "json4s-jackson" % json4sVersion
)
val logback: Seq[ModuleID] = Seq(
"ch.qos.logback" % "logback-core" % logbackVersion,
"ch.qos.logback" % "logback-classic" % logbackVersion
)
val nimbus: Seq[ModuleID] = Seq(
"com.nimbusds" % "nimbus-jose-jwt" % nimbusVersion,
"net.minidev" % "json-smart" % "2.4.9"
)
val scalaTest: Seq[ModuleID] = Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion % Test
)
val sttp: Seq[ModuleID] = Seq(
"com.softwaremill.sttp.client3" %% "core" % sttpVersion,
"com.softwaremill.sttp.client3" %% "json4s" % sttpVersion
)
// --------------------------------------------- //
// Project and configuration for keycloak4s-core //
// --------------------------------------------- //
lazy val coreDependencies: Seq[ModuleID] = cats ++ json4s ++ logback ++ enumeratum
lazy val `keycloak4s-core` = (project in file("./keycloak4s-core"))
.settings(global: _*)
.settings(libraryDependencies ++= coreDependencies)
.settings(name := "keycloak4s-core-ce3", publishArtifact := true)
// ---------------------------------------------- //
// Project and configuration for keycloak4s-admin //
// ---------------------------------------------- //
lazy val `keycloak4s-admin` = (project in file("./keycloak4s-admin"))
.settings(global: _*)
.settings(libraryDependencies ++= sttp)
.settings(name := "keycloak4s-admin-ce3", publishArtifact := true)
.dependsOn(`keycloak4s-core`)
// --------------------------------------------------- //
// Project and configuration for keycloak4s-playground //
// --------------------------------------------------- //
val catsBackend: Seq[ModuleID] = Seq(
"com.softwaremill.sttp.client3" %% "armeria-backend-cats" % "3.8.13"
)
lazy val `keycloak4s-playground` = (project in file("./keycloak4s-playground"))
.settings(scalaVersion := "2.13.8")
.settings(publish / skip := true)
.settings(libraryDependencies ++= scalaTest ++ catsBackend)
.settings(coverageEnabled := false)
.settings(Test / parallelExecution := false)
.settings(scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 => scalac212Opts
case _ => scalac213Opts
}))
.settings(addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3"))
.settings(name := "keycloak4s-playground", publishArtifact := false)
.dependsOn(`keycloak4s-admin`)
// ---------------------------------------------- //
// Project and configuration for the root project //
// ---------------------------------------------- //
lazy val root = (project in file("."))
.settings(global: _*)
.settings(publishArtifact := false)
.settings(publish / skip := true)
.aggregate(
`keycloak4s-core`,
`keycloak4s-admin`,
`keycloak4s-playground`
)