-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild.sbt
173 lines (158 loc) · 5.57 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
import xerial.sbt.Sonatype.GitHubHosting
import ReleaseTransformations.*
import sbtghactions.JavaSpec
import Utils.*
val scala212 = "2.12.20"
val scala213 = "2.13.16"
val scala3 = "3.3.4"
val supportedScalaVersions = List(scala212, scala213, scala3)
ThisBuild / scalaVersion := scala213
ThisBuild / organization := "io.github.kirill5k"
ThisBuild / homepage := Some(url("https://kirill5k.github.io/mongo4cats"))
ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/kirill5k/mongo4cats"), "[email protected]:kirill5k/mongo4cats.git"))
ThisBuild / developers := List(Developer("kirill5k", "Kirill", "[email protected]", url("https://github.com/kirill5k")))
ThisBuild / licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
ThisBuild / sonatypeProjectHosting := Some(GitHubHosting("kirill5k", "mongo4cats", "[email protected]"))
ThisBuild / publishTo := sonatypePublishToBundle.value
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / githubWorkflowPublishTargetBranches := Nil
ThisBuild / githubWorkflowScalaVersions := supportedScalaVersions
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17"))
ThisBuild / testFrameworks ++= Seq(new TestFramework("zio.test.sbt.ZTestFramework"))
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)
val noPublish = Seq(
publish := {},
publishLocal := {},
publishArtifact := false,
publish / skip := true
)
val commonSettings = Seq(
organizationName := "MongoDB Java client wrapper for Cats-Effect & FS2",
startYear := Some(2020),
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.txt")),
headerLicense := Some(HeaderLicense.ALv2("2020", "Kirill5k")),
resolvers += "Apache public" at "https://repository.apache.org/content/groups/public/",
scalafmtOnCompile := true,
crossScalaVersions := supportedScalaVersions,
Compile / doc / scalacOptions ++= Seq(
"-no-link-warnings" // Suppresses problems with Scaladoc links
),
parallelExecution := false,
test / parallelExecution := false,
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % "0.5.0"),
scalacOptions ++= partialUnificationOption(scalaVersion.value),
scalacOptions ~= { options: Seq[String] => options.filterNot(Set("-Wnonunit-statement")) }
)
val embedded = project
.in(file("modules/embedded"))
.settings(commonSettings)
.settings(
name := "mongo4cats-embedded",
libraryDependencies ++= Dependencies.embedded
)
.enablePlugins(AutomateHeaderPlugin)
val `zio-embedded` = project
.in(file("modules/zio-embedded"))
.settings(commonSettings)
.settings(
name := "mongo4cats-zio-embedded",
libraryDependencies ++= Dependencies.zioEmbedded
)
.enablePlugins(AutomateHeaderPlugin)
val kernel = project
.in(file("modules/kernel"))
.settings(commonSettings)
.settings(
name := "mongo4cats-kernel",
libraryDependencies ++= Dependencies.kernel
)
.enablePlugins(AutomateHeaderPlugin)
val core = project
.in(file("modules/core"))
.dependsOn(kernel % "test->test;compile->compile", embedded % "test->compile")
.settings(commonSettings)
.settings(
name := "mongo4cats-core",
libraryDependencies ++= Dependencies.core,
libraryDependencies ++= kindProjectorDependency(scalaVersion.value)
)
.enablePlugins(AutomateHeaderPlugin)
val zio = project
.in(file("modules/zio"))
.dependsOn(kernel % "test->test;compile->compile", `zio-embedded` % "test->compile")
.settings(commonSettings)
.settings(
name := "mongo4cats-zio",
libraryDependencies ++= Dependencies.zio,
libraryDependencies ++= kindProjectorDependency(scalaVersion.value)
)
.enablePlugins(AutomateHeaderPlugin)
val circe = project
.in(file("modules/circe"))
.dependsOn(kernel % "test->test;compile->compile", core % "test->compile", embedded % "test->compile")
.settings(commonSettings)
.settings(
name := "mongo4cats-circe",
libraryDependencies ++= Dependencies.circe
)
.enablePlugins(AutomateHeaderPlugin)
val `zio-json` = project
.in(file("modules/zio-json"))
.dependsOn(kernel % "test->test;compile->compile", core % "test->compile", embedded % "test->compile")
.settings(commonSettings)
.settings(
name := "mongo4cats-zio-json",
libraryDependencies ++= Dependencies.zioJson
)
.enablePlugins(AutomateHeaderPlugin)
val examples = project
.in(file("examples"))
.dependsOn(core, circe, embedded, zio, `zio-embedded`, `zio-json`)
.settings(noPublish)
.settings(commonSettings)
.settings(
name := "mongo4cats-examples",
libraryDependencies ++= Dependencies.examples
)
.enablePlugins(AutomateHeaderPlugin)
val website = project
.in(file("website"))
.dependsOn(kernel, core, circe, embedded, zio, `zio-embedded`, `zio-json`)
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(noPublish)
.settings(commonSettings)
.settings(
moduleName := "mongo4cats",
mdocVariables := Map(
"VERSION" -> version.value
)
)
val root = project
.in(file("."))
.settings(noPublish)
.settings(
name := "mongo4cats",
crossScalaVersions := Nil
)
.aggregate(
kernel,
core,
zio,
circe,
`zio-json`,
examples,
embedded,
`zio-embedded`
)