forked from Verizon/quiver
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
90 lines (83 loc) · 2.97 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
import java.net.URL
lazy val quiver = project
.in(file("."))
.aggregate(core.jvm, core.js, codecs.jvm, codecs.js, docs)
.settings(
skip in publish := true
)
val CatsVersion = "2.2.0"
val SilencerVersion = "1.7.1"
val ScalacheckShapeless = "1.2.5"
val CollectionsCompat = "2.2.0"
val ScodecVersion = "1.11.7"
lazy val core = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("core"))
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-free" % CatsVersion,
"org.scala-lang.modules" %%% "scala-collection-compat" % CollectionsCompat,
"org.typelevel" %%% "cats-laws" % CatsVersion % Test,
"com.github.alexarchambault" %%% "scalacheck-shapeless_1.14" % ScalacheckShapeless % Test
)
)
.settings(commonSettings)
.settings(silenceCompat)
.settings(coverageEnabled := scalaBinaryVersion.value != "2.13")
.jsSettings(coverageEnabled := false)
val commonSettings = Seq(
organization in Global := "io.getnelson.quiver",
scalaVersion in Global := crossScalaVersions.value.head,
crossScalaVersions in Global := Seq("2.13.3", "2.12.12"),
)
val silenceCompat = Seq(
libraryDependencies ++= Seq(
compilerPlugin(
"com.github.ghik" % "silencer-plugin" % SilencerVersion cross CrossVersion.full
),
"com.github.ghik" % "silencer-lib" % SilencerVersion % Provided cross CrossVersion.full
),
scalacOptions in Compile ++= Seq(
"""-P:silencer:lineContentFilters=import scala\.collection\.compat\._"""
)
)
lazy val codecs = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("codecs"))
.dependsOn(core % "test->test;compile->compile")
.settings(
libraryDependencies += "org.scodec" %%% "scodec-core" % ScodecVersion
)
.settings(commonSettings)
.settings(coverageEnabled := scalaBinaryVersion.value != "2.13")
.jsSettings(coverageEnabled := false)
lazy val docsMappingsAPIDir = settingKey[String](
"Name of subdirectory in site target directory for api docs"
)
lazy val docs = project
.in(file("quiver-docs"))
.dependsOn(core.jvm, codecs.jvm)
.enablePlugins(MdocPlugin, MicrositesPlugin, ScalaUnidocPlugin)
.settings(
unidocProjectFilter in (ScalaUnidoc, unidoc) := inProjects(
core.jvm,
codecs.jvm
),
docsMappingsAPIDir := "api",
addMappingsToSiteDir(
mappings in (ScalaUnidoc, packageDoc),
docsMappingsAPIDir
),
mdocVariables := {
val stableVersion: String =
version.value.replaceFirst("[\\+\\-].*", "")
Map("VERSION" -> stableVersion)
},
mdocIn := (baseDirectory in ThisBuild).value / "docs" / "mdoc",
micrositeName := "Quiver - a Scala graph library",
micrositeUrl := "https://getnelson.github.io",
micrositeDocumentationUrl := "/quiver/api/index.html",
micrositeDocumentationLabelDescription := "API Documentation",
micrositeBaseUrl := "/quiver"
)
.settings(silenceCompat)