-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sbt
138 lines (131 loc) · 4.51 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
import laika.helium.config._
import laika.config.{ChoiceConfig, Selections, SelectionConfig}
import java.io.File
ThisBuild / tlBaseVersion := "0.1"
ThisBuild / startYear := Some(2023)
ThisBuild / tlSitePublishBranch := Some("main")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17"))
ThisBuild / mergifyStewardConfig ~= {
_.map(_.withAuthor("typelevel-steward[bot]"))
}
ThisBuild / crossScalaVersions := Seq("2.13.15", "3.3.4")
lazy val root = tlCrossRootProject
.aggregate(toolkit, toolkitTest, tests)
lazy val toolkit = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("toolkit"))
.settings(
name := "toolkit",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % "2.11.0",
"org.typelevel" %%% "cats-effect" % "3.5.7",
"co.fs2" %%% "fs2-io" % "3.11.0",
"org.gnieh" %%% "fs2-data-csv" % "1.11.1",
"org.gnieh" %%% "fs2-data-csv-generic" % "1.11.1",
"org.http4s" %%% "http4s-ember-client" % "0.23.29",
"io.circe" %%% "circe-jawn" % "0.14.8",
"org.http4s" %%% "http4s-circe" % "0.23.29",
"com.monovore" %%% "decline-effect" % "2.4.1"
),
mimaPreviousArtifacts := Set()
)
lazy val toolkitTest = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("toolkit-test"))
.settings(
name := "toolkit-test",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % "2.11.0",
"org.typelevel" %%% "cats-effect-testkit" % "3.5.7",
"org.scalameta" %%% "munit" % "1.0.0", // not % Test, on purpose :)
"org.typelevel" %%% "munit-cats-effect" % "2.0.0"
),
mimaPreviousArtifacts := Set()
)
lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("tests"))
.settings(
name := "tests",
libraryDependencies ++= Seq(
"org.typelevel" %%% "munit-cats-effect" % "2.0.0" % Test,
"co.fs2" %%% "fs2-io" % "3.11.0" % Test,
"org.virtuslab.scala-cli" %% "cli" % "1.4.0" cross (CrossVersion.for2_13Use3)
),
buildInfoKeys += scalaBinaryVersion,
buildInfoKeys += "nativeVersion" -> nativeVersion,
buildInfoKeys += BuildInfoKey.map(Compile / dependencyClasspath) {
case (_, v) =>
"classPath" -> v.seq
.map(_.data.getAbsolutePath)
.mkString(File.pathSeparator)
},
buildInfoKeys += BuildInfoKey.action("javaHome") {
val path = sys.env.get("JAVA_HOME").orElse(sys.props.get("java.home")).get
if (path.endsWith("/jre")) {
// handle JDK 8 installations
path.replace("/jre", "")
} else path
},
buildInfoKeys += "scala3" -> (scalaBinaryVersion.value == "3")
)
.jvmSettings(
Test / test := (Test / test)
.dependsOn(toolkit.jvm / publishLocal, toolkitTest.jvm / publishLocal)
.value,
buildInfoKeys += "platform" -> "jvm"
)
.jsSettings(
Test / test := (Test / test)
.dependsOn(toolkit.js / publishLocal, toolkitTest.js / publishLocal)
.value,
buildInfoKeys += "platform" -> "js",
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }
)
.nativeSettings(
Test / test := (Test / test)
.dependsOn(
toolkit.native / publishLocal,
toolkitTest.native / publishLocal
)
.value,
buildInfoKeys += "platform" -> "native"
)
.enablePlugins(BuildInfoPlugin, NoPublishPlugin)
lazy val docs = project
.in(file("site"))
.enablePlugins(TypelevelSitePlugin)
.dependsOn(toolkit.jvm)
.settings(
scalaVersion := "3.3.4",
tlSiteHelium ~= {
_.site.mainNavigation(
appendLinks = List(
ThemeNavigationSection(
"Related Projects",
TextLink.external("https://github.com/typelevel/fs2", "fs2"),
TextLink.external("https://github.com/typelevel/cats", "Cats"),
TextLink.external("https://github.com/circe/circe", "Circe"),
TextLink.external("https://github.com/http4s/http4s", "Http4s"),
TextLink.external("https://github.com/bkirwi/decline", "Decline"),
TextLink.external(
"https://github.com/typelevel/cats-effect",
"Cats Effect"
),
TextLink.external(
"https://github.com/typelevel/munit-cats-effect",
"Munit Cats Effect"
)
)
)
)
},
laikaConfig ~= {
_.withConfigValue(
Selections(
SelectionConfig(
"scala-version",
ChoiceConfig("scala-3", "Scala 3"),
ChoiceConfig("scala-2", "Scala 2")
)
)
)
}
)