forked from zio/zio-logging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
149 lines (134 loc) · 5.01 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
import BuildHelper._
import MimaSettings.mimaSettings
import sbtcrossproject.CrossPlugin.autoImport.{ CrossType, crossProject }
name := "zio-logging"
inThisBuild(
List(
organization := "dev.zio",
homepage := Some(url("https://zio.github.io/zio-logging/")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer("jdegoes", "John De Goes", "[email protected]", url("http://degoes.net")),
Developer(
"pshemass",
"Przemyslaw Wierzbicki",
url("https://github.com/pshemass")
)
)
)
)
val ZioVersion = "2.0.0"
val scalaJavaTimeVersion = "2.3.0"
val slf4jVersion = "1.7.36"
val logbackVersion = "1.2.11"
addCommandAlias("fix", "; all compile:scalafix test:scalafix; all scalafmtSbt scalafmtAll")
addCommandAlias("check", "; scalafmtSbtCheck; scalafmtCheckAll; compile:scalafix --check; test:scalafix --check")
addCommandAlias(
"testJVM",
";coreJVM/test;slf4j/test;slf4jBridge/test"
)
addCommandAlias(
"testJS",
";coreJS/test"
)
addCommandAlias(
"mimaChecks",
"all coreJVM/mimaReportBinaryIssues slf4j/mimaReportBinaryIssues slf4jBridge/mimaReportBinaryIssues"
)
lazy val root = project
.in(file("."))
.settings(
publish / skip := true
)
.aggregate(coreJVM, coreJS, slf4j, slf4jBridge, benchmarks, docs, examples)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.in(file("core"))
.settings(stdSettings("zio-logging"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %%% "zio" % ZioVersion,
"dev.zio" %%% "zio-streams" % ZioVersion,
"dev.zio" %%% "zio-test" % ZioVersion % Test,
"dev.zio" %%% "zio-test-sbt" % ZioVersion % Test
),
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework"))
)
.jvmSettings(
Test / fork := true,
run / fork := true,
mimaSettings(failOnProblem = true)
)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js.settings(
libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.4.0" % Test
)
lazy val slf4j = project
.in(file("slf4j"))
.dependsOn(coreJVM)
.settings(stdSettings("zio-logging-slf4j"))
.settings(mimaSettings(failOnProblem = true))
.settings(
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % slf4jVersion,
"dev.zio" %%% "zio-test" % ZioVersion % Test,
"dev.zio" %%% "zio-test-sbt" % ZioVersion % Test,
"ch.qos.logback" % "logback-classic" % logbackVersion % Test,
"net.logstash.logback" % "logstash-logback-encoder" % "6.6" % Test,
"org.scala-lang.modules" %% "scala-collection-compat" % "2.8.1" % Test
),
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework"))
)
lazy val slf4jBridge = project
.in(file("slf4j-bridge"))
.dependsOn(coreJVM)
.settings(stdSettings("zio-logging-slf4j-bridge"))
.settings(mimaSettings(failOnProblem = true))
.settings(
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % slf4jVersion,
"dev.zio" %%% "zio-test" % ZioVersion % Test,
"dev.zio" %%% "zio-test-sbt" % ZioVersion % Test
),
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework"))
)
lazy val benchmarks = project
.in(file("benchmarks"))
.settings(stdSettings("zio-logging-benchmarks"))
.settings(
publish / skip := true,
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings"
)
.dependsOn(coreJVM)
.enablePlugins(JmhPlugin)
lazy val docs = project
.in(file("zio-logging-docs"))
.settings(
publish / skip := true,
moduleName := "zio-logging-docs",
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
crossScalaVersions --= List(Scala211, Scala3),
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(coreJVM, slf4j),
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
cleanFiles += (ScalaUnidoc / unidoc / target).value,
docusaurusCreateSite := docusaurusCreateSite.dependsOn(Compile / unidoc).value,
docusaurusPublishGhpages := docusaurusPublishGhpages.dependsOn(Compile / unidoc).value
)
.dependsOn(coreJVM, slf4j)
.enablePlugins(MdocPlugin, DocusaurusPlugin, ScalaUnidocPlugin)
lazy val examples = project
.in(file("examples"))
.dependsOn(slf4j)
.settings(stdSettings("zio-logging-examples"))
.settings(
publish / skip := true,
libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % logbackVersion,
"net.logstash.logback" % "logstash-logback-encoder" % "6.6",
"dev.zio" %%% "zio-test" % ZioVersion % Test,
"dev.zio" %%% "zio-test-sbt" % ZioVersion % Test
)
)