forked from theiterators/sealed-monad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
141 lines (127 loc) · 4.61 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
import com.jsuereth.sbtpgp.PgpKeys
import sbtrelease.ReleasePlugin.autoImport._
import sbtrelease.ReleaseStateTransformations._
val isDotty = Def.setting(CrossVersion.partialVersion(scalaVersion.value).exists(_._1 != 2))
// Dependencies
val catsVersion = "2.7.0"
val castsTestkitScalatestVersion = "2.1.5"
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % catsVersion,
"org.typelevel" %% "cats-laws" % catsVersion % Test,
"org.typelevel" %% "cats-testkit" % catsVersion % Test,
"org.typelevel" %% "cats-testkit-scalatest" % castsTestkitScalatestVersion % Test
)
libraryDependencies ++= (if (isDotty.value) Nil
else
Seq(compilerPlugin("org.typelevel" %% "kind-projector" % "0.13.2" cross CrossVersion.full)))
// Multiple Scala versions support
val scala_2_12 = "2.12.15"
val scala_2_13 = "2.13.8"
val dotty = "3.1.0"
val mainScalaVersion = scala_2_13
val supportedScalaVersions = Seq(scala_2_12, scala_2_13, dotty)
lazy val baseSettings = Seq(
// Scala settings
homepage := Some(url("https://github.com/theiterators/sealed-monad")),
scalaVersion := mainScalaVersion,
scalacOptions := Seq("-deprecation", "-unchecked", "-feature", "-encoding", "utf8") ++
(if (isDotty.value)
Seq("-language:implicitConversions", "-Ykind-projector", "-Xignore-scala2-macros")
else Nil),
scalafmtOnCompile := true,
// Sonatype settings
publishTo := sonatypePublishTo.value,
sonatypeProfileName := "pl.iterators",
publishMavenStyle := true,
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
organization := "pl.iterators",
organizationName := "Iterators",
organizationHomepage := Some(url("https://iterato.rs")),
developers := List(
Developer(
id = "mrzeznicki",
name = "Marcin Rzeźnicki",
email = "[email protected]",
url = url("https://github.com/marcin-rzeznicki")
)
),
scmInfo := Some(
ScmInfo(
browseUrl = url("https://github.com/theiterators/sealed-monad"),
connection = "scm:git:https://github.com/theiterators/sealed-monad.git"
)
),
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
crossScalaVersions := supportedScalaVersions,
releaseCrossBuild := true
)
lazy val noPublishSettings =
Seq(
publishArtifact := false,
releaseCrossBuild := false,
skip / publish := true,
releasePublishArtifactsAction := {
val projectName = name.value
streams.value.log.warn(s"Publishing for $projectName is turned off")
}
)
lazy val examples = project
.in(file("examples"))
.dependsOn(sealedMonad % "test->test;compile->compile")
.settings(baseSettings: _*)
.settings(noPublishSettings: _*)
.settings(
name := "examples",
description := "Sealed monad - snippets of example code",
moduleName := "sealed-examples"
)
lazy val docs = project
.in(file("sealed-docs"))
.dependsOn(sealedMonad % "test->test;compile->compile")
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(baseSettings: _*)
.settings(noPublishSettings: _*)
.settings(
name := "docs",
description := "Sealed monad documentation",
moduleName := "sealed-docs"
)
.settings(
mdocVariables := Map(
"VERSION" -> version.value
)
)
lazy val benchmarks = project
.in(file("benchmarks"))
.dependsOn(sealedMonad % "test->test;compile->compile")
.enablePlugins(JmhPlugin)
.settings(baseSettings: _*)
.settings(noPublishSettings: _*)
.settings(
name := "benchmarks",
description := "Sealed monad benchmarks",
moduleName := "sealed-benchmarks"
)
addCommandAlias("flame", "benchmarks/jmh:run -p tokens=64 -prof jmh.extras.Async:dir=target/flamegraphs;flameGraphOpts=--width,1900")
lazy val sealedMonad = project
.in(file("."))
.settings(baseSettings: _*)
.settings(
name := "sealed-monad",
description := "Scala library for nice for-comprehension-style error handling",
releaseProcess := Seq(
checkSnapshotDependencies,
inquireVersions,
releaseStepCommandAndRemaining("+publishLocalSigned"),
releaseStepCommandAndRemaining("+clean"),
releaseStepCommandAndRemaining("+test"),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
pushChanges
)
)