-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
121 lines (107 loc) · 3.86 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
val isDotty = Def.setting(CrossVersion.partialVersion(scalaVersion.value).exists(_._1 != 2))
// Dependencies
val catsVersion = "2.10.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.18"
val scala_2_13 = "2.13.12"
val dotty = "3.3.1"
val mainScalaVersion = scala_2_13
val supportedScalaVersions = Seq(scala_2_12, scala_2_13, dotty)
ThisBuild / crossScalaVersions := supportedScalaVersions
ThisBuild / scalaVersion := mainScalaVersion
lazy val baseSettings = Seq(
// Scala settings
homepage := Some(url("https://github.com/theiterators/sealed-monad")),
scalacOptions := Seq("-deprecation", "-unchecked", "-feature", "-encoding", "utf8") ++
(if (isDotty.value)
Seq("-language:implicitConversions", "-Ykind-projector", "-Xignore-scala2-macros")
else Nil),
scalafmtOnCompile := true,
// Sonatype settings
sonatypeProfileName := "pl.iterators",
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
organization := "pl.iterators",
organizationName := "Iterators",
organizationHomepage := Some(url("https://www.iteratorshq.com")),
developers := List(
Developer(
id = "mrzeznicki",
name = "Marcin Rzeźnicki",
email = "[email protected]",
url = url("https://github.com/marcin-rzeznicki")
),
Developer(
id = "pkiersznowski",
name = "Paweł Kiersznowski",
email = "[email protected]",
url = url("https://github.com/pk044")
)
),
scmInfo := Some(
ScmInfo(
browseUrl = url("https://github.com/theiterators/sealed-monad"),
connection = "scm:git:https://github.com/theiterators/sealed-monad.git"
)
),
crossScalaVersions := supportedScalaVersions
)
lazy val noPublishSettings =
Seq(
publishArtifact := false,
skip / publish := true
)
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"
)