forked from typelevel/log4cats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
293 lines (261 loc) · 8.04 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
import sbtcrossproject.{crossProject, CrossType}
val catsV = "1.6.0"
val catsEffectV = "1.2.0"
val log4sV = "1.7.0"
val specs2V = "4.5.1"
lazy val log4cats = project.in(file("."))
.aggregate(
coreJVM,
coreJS,
testingJVM,
testingJS,
noopJVM,
noopJS,
scribeJVM,
scribeJS,
slf4j,
log4sJVM,
log4sJS,
extrasJVM,
extrasJS,
docs,
`scalaz-log4s`
)
.settings(noPublishSettings)
.settings(commonSettings, releaseSettings)
lazy val docs = project.in(file("docs"))
.settings(noPublishSettings)
.settings(commonSettings, micrositeSettings)
.enablePlugins(MicrositesPlugin)
.enablePlugins(TutPlugin)
.dependsOn(slf4j)
lazy val core = crossProject(JSPlatform, JVMPlatform).in(file("core"))
.settings(commonSettings, releaseSettings, mimaSettings)
.settings(
name := "log4cats-core"
)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val extras = crossProject(JSPlatform, JVMPlatform).in(file("cats/extras"))
.settings(commonSettings, releaseSettings, mimaSettings, catsSettings)
.dependsOn(core)
.settings(
name := "log4cats-extras"
)
lazy val extrasJVM = extras.jvm
lazy val extrasJS = extras.js
lazy val testing = crossProject(JSPlatform, JVMPlatform).in(file("cats/testing"))
.settings(commonSettings, releaseSettings, mimaSettings, catsSettings)
.dependsOn(core)
.settings(
name := "log4cats-testing"
)
lazy val testingJVM = testing.jvm
lazy val testingJS = testing.js
lazy val noop = crossProject(JSPlatform, JVMPlatform).in(file("cats/noop"))
.settings(commonSettings, mimaSettings, releaseSettings)
.dependsOn(core)
.settings(
name := "log4cats-noop",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % catsV,
)
)
lazy val noopJVM = noop.jvm
lazy val noopJS = noop.js
lazy val log4s = crossProject(JSPlatform, JVMPlatform).in(file("cats/log4s"))
.settings(commonSettings, releaseSettings, mimaSettings, catsSettings)
.dependsOn(core)
.settings(
name := "log4cats-log4s",
libraryDependencies ++= Seq(
"org.log4s" %%% "log4s" % log4sV
)
)
lazy val slf4j = project.in(file("cats/slf4j"))
.settings(commonSettings, releaseSettings, mimaSettings, catsSettings)
.dependsOn(coreJVM)
.settings(
name := "log4cats-slf4j",
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "1.7.26"
)
)
lazy val log4sJVM = log4s.jvm
lazy val log4sJS = log4s.js
lazy val scribe = crossProject(JSPlatform, JVMPlatform).in(file("cats/scribe"))
.settings(commonSettings, releaseSettings, mimaSettings, catsSettings)
.dependsOn(core)
.settings(
name := "log4cats-scribe",
libraryDependencies ++= Seq(
"com.outr" %%% "scribe" % "2.7.2"
)
)
lazy val scribeJVM = scribe.jvm
lazy val scribeJS = scribe.js
// Scalaz Projects
lazy val `scalaz-log4s` = project
.in(file("scalaz/log4s"))
.settings(commonSettings, releaseSettings, mimaSettings, scalazSettings)
.dependsOn(coreJVM)
.settings(
name := "log4scalaz-log4s",
libraryDependencies ++= Seq(
"org.log4s" %%% "log4s" % log4sV
)
)
lazy val contributors = Seq(
"ChristopherDavenport" -> "Christopher Davenport",
"lorandszakacs" -> "Loránd Szakács"
)
lazy val commonSettings = Seq(
organization := "io.chrisdavenport",
scalaVersion := "2.12.8",
crossScalaVersions := Seq(scalaVersion.value, "2.11.12"),
addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.10" cross CrossVersion.binary),
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.2.4"),
libraryDependencies ++= Seq(
"org.specs2" %%% "specs2-core" % specs2V % Test
// "org.specs2" %% "specs2-scalacheck" % specs2V % Test
)
)
lazy val catsSettings = Seq(
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % catsV,
"org.typelevel" %%% "cats-effect" % catsEffectV
)
)
lazy val scalazSettings = Seq(
libraryDependencies += "org.scalaz" %% "scalaz-zio" % "0.6.3"
)
lazy val releaseSettings = {
import ReleaseTransformations._
Seq(
releaseCrossBuild := true,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
// For non cross-build projects, use releaseStepCommand("publishSigned")
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
),
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")
},
credentials ++= (
for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
} yield
Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username,
password
)
).toSeq,
publishArtifact in Test := false,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
scmInfo := Some(
ScmInfo(
url("https://github.com/ChristopherDavenport/log4cats"),
"[email protected]:ChristopherDavenport/log4cats.git"
)
),
homepage := Some(url("https://github.com/ChristopherDavenport/log4cats")),
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")),
publishMavenStyle := true,
pomIncludeRepository := { _ =>
false
},
pomExtra := {
<developers>
{for ((username, name) <- contributors) yield
<developer>
<id>{username}</id>
<name>{name}</name>
<url>http://github.com/{username}</url>
</developer>
}
</developers>
}
)
}
lazy val micrositeSettings = Seq(
micrositeName := "log4cats",
micrositeDescription := "Functional Logging",
micrositeAuthor := "Christopher Davenport",
micrositeGithubOwner := "ChristopherDavenport",
micrositeGithubRepo := "log4cats",
micrositeBaseUrl := "/log4cats",
micrositeDocumentationUrl := "https://christopherdavenport.github.io/log4cats",
micrositeFooterText := None,
micrositeHighlightTheme := "atom-one-light",
micrositePalette := Map(
"brand-primary" -> "#3e5b95",
"brand-secondary" -> "#294066",
"brand-tertiary" -> "#2d5799",
"gray-dark" -> "#49494B",
"gray" -> "#7B7B7E",
"gray-light" -> "#E5E5E6",
"gray-lighter" -> "#F4F3F4",
"white-color" -> "#FFFFFF"
),
fork in tut := true,
scalacOptions in Tut --= Seq(
"-Xfatal-warnings",
"-Ywarn-unused-import",
"-Ywarn-numeric-widen",
"-Ywarn-dead-code",
"-Ywarn-unused:imports",
"-Xlint:-missing-interpolator,_"
),
libraryDependencies += "com.47deg" %% "github4s" % "0.20.1",
micrositePushSiteWith := GitHub4s,
micrositeGithubToken := sys.env.get("GITHUB_TOKEN")
)
// Not Used Currently
lazy val mimaSettings = {
import sbtrelease.Version
def mimaVersion(version: String) = {
Version(version) match {
case Some(Version(major, Seq(minor, patch), _)) if patch.toInt > 0 =>
Some(s"${major}.${minor}.${patch.toInt - 1}")
case _ =>
None
}
}
Seq(
mimaFailOnProblem := mimaVersion(version.value).isDefined,
mimaPreviousArtifacts := (mimaVersion(version.value) map {
organization.value % s"${moduleName.value}_${scalaBinaryVersion.value}" % _
}).toSet,
mimaBinaryIssueFilters ++= {
import com.typesafe.tools.mima.core._
import com.typesafe.tools.mima.core.ProblemFilters._
Seq()
}
)
}
lazy val noPublishSettings = {
import com.typesafe.sbt.pgp.PgpKeys.publishSigned
Seq(
publish := {},
publishLocal := {},
publishSigned := {},
publishArtifact := false
)
}