-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
68 lines (61 loc) · 2.23 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
lazy val commonSettings = Seq(
Compile / compile / javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => Seq(compilerPlugin(Dependencies.kindProjector))
case _ => Seq.empty
}
},
scalacOptions += {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => "-Wconf:any:wv"
case _ => "-Wconf:any:v"
}
},
Test / fork := true,
resolvers += Resolver.sonatypeRepo("releases"),
ThisBuild / evictionErrorLevel := Level.Error,
)
lazy val noPublishSettings =
commonSettings ++ Seq(publish := {}, publishArtifact := false, publishTo := None, publish / skip := true)
lazy val publishSettings = commonSettings ++ Seq(
publishMavenStyle := true,
pomIncludeRepository := { _ =>
false
},
Test / publishArtifact := false
)
lazy val mimaSettings = Seq(
mimaPreviousArtifacts := previousStableVersion.value.map(organization.value %% moduleName.value % _).toSet
)
lazy val documentationSettings = Seq(
autoAPIMappings := true,
apiMappings ++= {
// Lookup the path to jar from the classpath
val classpath = (Compile / fullClasspath).value
def findJar(nameBeginsWith: String): File =
classpath
.find { attributed: Attributed[java.io.File] => (attributed.data ** s"$nameBeginsWith*.jar").get.nonEmpty }
.get
.data // fail hard if not found
// Define external documentation paths
Map(findJar("cats-effect") -> url("https://typelevel.org/cats-effect/api/3.x/cats/index.html"))
}
)
lazy val root = (project in file("."))
.settings(noPublishSettings)
.settings(name := "HotswapRef")
.aggregate(core)
lazy val core =
(project in file("modules/core"))
.settings(publishSettings)
.settings(mimaSettings)
.settings(documentationSettings)
.settings(
name := "hotswap-ref",
libraryDependencies ++= Seq(Dependencies.cats, Dependencies.catsEffectStd),
libraryDependencies ++= Dependencies.test.map(_ % Test)
)
addCommandAlias("fmt", "all root/scalafmtSbt root/scalafmtAll")
addCommandAlias("fmtCheck", "all root/scalafmtSbtCheck root/scalafmtCheckAll")
addCommandAlias("mima", "core/mimaReportBinaryIssues")