-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
235 lines (218 loc) · 7.33 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
import laika.helium.Helium
import laika.helium.config.*
import laika.config.SyntaxHighlighting
import laika.format.Markdown
import laika.ast.Path.Root
import laika.theme.config.Color
import laika.ast.LengthUnit.*
import laika.ast.*
import com.typesafe.tools.mima.core.Problem
import com.typesafe.tools.mima.core.ProblemFilters
import org.scalajs.linker.interface.ModuleSplitStyle
import java.time.OffsetDateTime
ThisBuild / githubWorkflowBuildPreamble ++= Seq(
WorkflowStep.Use(
UseRef.Public("actions", "setup-node", "v3"),
name = Some("Setup NodeJS v18 LTS"),
params = Map("node-version" -> "18", "cache" -> "npm"),
cond = Some("matrix.project == 'rootJS'")
),
WorkflowStep.Run(
List("npm install"),
cond = Some("matrix.project == 'rootJS'")
)
)
Global / onChangedBuildSource := ReloadOnSourceChanges
import java.io.File
val scalaV = "3.3.1"
inThisBuild(
List(
scalaVersion := scalaV
)
)
inThisBuild(
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[Problem]("viz.dsl.*") // don't maintain the DSL
)
)
ThisBuild / tlVersionIntroduced := Map("3" -> "1.0.0") // disable mima for now
ThisBuild / tlSitePublishBranch := Some("main")
ThisBuild / tlBaseVersion := "0.9"
ThisBuild / organization := "io.github.quafadas"
ThisBuild / organizationName := "quafadas"
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / developers := List(
// your GitHub handle and name
tlGitHubDev("quafadas", "Simon Parten")
)
ThisBuild / tlSonatypeUseLegacyHost := false
ThisBuild / tlCiReleaseBranches := Seq("main")
ThisBuild / scalaVersion := scalaV
lazy val root = tlCrossRootProject.aggregate(core, dedav_laminar, dedav_calico, unidocs, tests)
lazy val core = crossProject(JVMPlatform, JSPlatform)
.in(file("core"))
.settings(
name := "dedav4s",
description := "Declarative data viz for scala",
scalacOptions ++= Seq(
"-Xmax-inlines:2000",
"""-Wconf:cat=deprecation:s"""
),
libraryDependencies ++= Seq(
"com.lihaoyi" %%% "upickle" % "3.1.4",
"com.lihaoyi" %%% "scalatags" % "0.12.0",
"org.ekrich" %%% "sconfig" % "1.6.0",
"com.github.tarao" %%% "record4s" % "0.11.2",
"com.github.tarao" %%% "record4s-upickle" % "0.11.2"
// ("sh.almond" % "scala-kernel-api" % "0.13.14" % Provided)
// .cross(CrossVersion.for3Use2_13With("", ".10"))
// .exclude("com.lihaoyi", "geny_2.13")
// .exclude("com.lihaoyi", "sourcecode_2.13")
// .exclude("com.lihaoyi", "fansi_2.13")
// .exclude("com.lihaoyi", "os-lib_2.13")
// .exclude("com.lihaoyi", "pprint_2.13")
// .exclude("org.scala-lang.modules", "scala-collection-compat_2.13")
// .exclude("com.github.jupyter", "jvm-repr")
)
)
.jvmSettings(
libraryDependencies ++= Seq(
"com.lihaoyi" %% "os-lib" % "0.9.3",
"com.lihaoyi" %% "cask" % "0.9.2",
"com.lihaoyi" %% "requests" % "0.8.0",
("sh.almond" %% "scala-kernel-api" % "0.14.0-RC14" % Provided)
.cross(CrossVersion.full)
.exclude("com.lihaoyi", "geny_2.13")
.exclude("org.scala-lang.modules", "scala-collection-compat_2.13")
.exclude("com.lihaoyi", "os-lib_2.13")
.exclude("com.github.jupyter", "jvm-repr"),
"org.jsoup" % "jsoup" % "1.17.2"
)
)
.jsSettings(
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.8.0",
("org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0").cross(CrossVersion.for3Use2_13)
)
)
// lazy val generated = crossProject(JVMPlatform, JSPlatform)
// .in(file("generated"))
// .dependsOn(core)
// .settings(
// tlFatalWarnings := false,
// scalacOptions ++= Seq(
// "-Xmax-inlines:2000"
// ),
// libraryDependencies ++= Seq(
// "io.circe" %%% "circe-core" % "0.14.6",
// "io.circe" %%% "circe-parser" % "0.14.6"
// )
// )
lazy val dedav_calico = project
.in(file("calico"))
.dependsOn(core.jvm)
.settings(
libraryDependencies += "com.armanbilge" %%% "calico" % "0.2.2"
)
.dependsOn(core.js)
.enablePlugins(ScalaJSPlugin)
lazy val dedav_laminar = project
.in(file("laminar"))
.settings(
libraryDependencies += "com.raquo" %%% "laminar" % "17.0.0"
)
.dependsOn(core.js)
.enablePlugins(ScalaJSPlugin)
lazy val tests = crossProject(JVMPlatform, JSPlatform)
.in(file("tests"))
.enablePlugins(NoPublishPlugin)
.dependsOn(core)
.settings(
libraryDependencies += "org.scalameta" %%% "munit" % "1.0.0" % Test
)
.jvmSettings(
name := "tests-jvm",
// classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat,
libraryDependencies += "com.microsoft.playwright" % "playwright" % "1.41.2" % Test,
libraryDependencies += "com.microsoft.playwright" % "driver-bundle" % "1.41.2" % Test
)
.jsSettings(
name := "tests-js",
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.ESModule),
},
scalaJSLinkerConfig ~= {
_.withModuleSplitStyle(ModuleSplitStyle.SmallModulesFor(List("viz")))
}
)
.jsEnablePlugins(ScalaJSImportMapPlugin)
lazy val jsdocs = project
.in(file("jsdocs"))
.settings(
scalaJSUseMainModuleInitializer := true,
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.8.0",
libraryDependencies += ("org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0").cross(CrossVersion.for3Use2_13),
libraryDependencies += ("io.github.cquiroz" %%% "scala-java-time" % "2.5.0").cross(CrossVersion.for3Use2_13),
// scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.ESModule))
)
.dependsOn(dedav_calico, dedav_laminar, core.js)
.enablePlugins(ScalaJSPlugin)
.enablePlugins(ScalaJSImportMapPlugin)
.enablePlugins(NoPublishPlugin)
lazy val unidocs = project
.in(file("unidocs"))
.enablePlugins(TypelevelUnidocPlugin) // also enables the ScalaUnidocPlugin
.settings(
name := "dedav4s-docs",
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(core.jvm)
)
lazy val docs = project
.in(file("myproject-docs")) // important: it must not be docs/
.dependsOn(core.jvm)
.settings(
mdocJS := Some(jsdocs),
mdocIn := new File("raw_docs"),
mdocVariables += "js-opt" -> "fast",
libraryDependencies ++= Seq(
("org.scalanlp" %% "breeze" % "2.1.0")
),
// laikaTheme := Helium.defaults.build,
// NOTE: Needed for Javasriptin in Laika
// laikaIncludeAPI := true,
laikaConfig ~= {
_.withRawContent
},
laikaExtensions := Seq(
Markdown.GitHubFlavor,
SyntaxHighlighting
),
tlSiteHelium := {
Helium.defaults.site
.metadata(
title = Some("Dedav4s"),
language = Some("en"),
description = Some("Declarative data visualisation for scala"),
authors = Seq("Simon Parten"),
datePublished = Some(OffsetDateTime.now)
)
.site
.topNavigationBar(
homeLink = IconLink.internal(Root / "README.md", HeliumIcon.home),
navLinks = Seq(IconLink.external("https://github.com/Quafadas/dedav4s", HeliumIcon.github))
)
Helium.defaults.site
.externalJS(
url = "https://cdn.jsdelivr.net/npm/vega@5"
)
.site
.externalJS(
url = "https://cdn.jsdelivr.net/npm/vega-lite@5"
)
.site
.externalJS(
url = "https://cdn.jsdelivr.net/npm/vega-embed@6"
)
}
)
.enablePlugins(TypelevelSitePlugin)
.enablePlugins(NoPublishPlugin)