This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
128 lines (116 loc) · 3.59 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
lazy val fmq = project
.in(file("."))
.settings(commonSettings)
.settings(commandSettings)
.settings(noPublishSettings)
.aggregate(core, extras)
lazy val core = project
.in(file("core"))
.settings(commonSettings)
.settings(commandSettings)
.settings(pluginAbsolutePathSettings)
.settings(
name := "fmq-core",
libraryDependencies ++= Dependencies.core(scalaVersion.value),
testFrameworks += new TestFramework("weaver.framework.CatsEffect")
)
lazy val extras = project
.in(file("extras"))
.settings(commonSettings)
.settings(commandSettings)
.settings(
name := "fmq-extras",
libraryDependencies ++= Dependencies.extras,
testFrameworks += new TestFramework("weaver.framework.CatsEffect")
)
.dependsOn(core)
lazy val bench = project
.in(file("bench"))
.enablePlugins(JmhPlugin)
.settings(commonSettings)
.settings(commandSettings)
.settings(noPublishSettings)
.settings(
name := "fmq-bench",
libraryDependencies += Dependencies.fs2
)
.dependsOn(core)
lazy val examples = project
.in(file("examples"))
.settings(commonSettings)
.settings(commandSettings)
.settings(noPublishSettings)
.settings(
name := "fmq-examples",
libraryDependencies += Dependencies.fs2
)
.dependsOn(core, extras)
lazy val docs = project
.in(file("fmq-docs"))
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(commonSettings)
.settings(noPublishSettings)
.settings(
name := "fmq-docs",
libraryDependencies += Dependencies.fs2,
mdocVariables := {
val currentValue = version.value.replaceFirst("\\+.*", "")
Map(
"VERSION" -> sys.env.getOrElse("RELEASE_VERSION", currentValue)
)
}
)
.dependsOn(core, extras)
lazy val commonSettings = Seq(
scalaVersion := Versions.scala_213,
crossScalaVersions := Seq(scalaVersion.value),
Test / fork := true,
Compile / compile / wartremoverErrors ++= Warts.allBut(Wart.Any, Wart.Nothing), // false positive
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.13.2" cross CrossVersion.full),
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1")
)
lazy val commandSettings = {
val ci = Command.command("ci") { state =>
"clean" ::
"coverage" ::
"scalafmtSbtCheck" ::
"scalafmtCheckAll" ::
"test" ::
"coverageReport" ::
"coverageAggregate" ::
state
}
val testAll = Command.command("testAll") { state =>
"clean" :: "coverage" :: "test" :: "coverageReport" :: "coverageAggregate" :: state
}
commands ++= List(ci, testAll)
}
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false,
publish / skip := true
)
// See https://github.com/sbt/sbt/issues/6027
lazy val pluginAbsolutePathSettings = Seq(Compile, Test).map { c =>
c / scalacOptions := {
val prefix = "-Xplugin:"
(c / scalacOptions).value.map { opt =>
if (opt.startsWith(prefix)) {
val originalPluginFile = file(opt.drop(prefix.length))
prefix + originalPluginFile.toPath.toAbsolutePath
} else {
opt
}
}
}
}
inThisBuild(
Seq(
organization := "io.github.irevive",
homepage := Some(url("https://github.com/iRevive/fmq")),
licenses := List("MIT" -> url("http://opensource.org/licenses/MIT")),
developers := List(Developer("iRevive", "Maksim Ochenashko", "", url("https://github.com/iRevive"))),
versionScheme := Some("semver-spec")
)
)