-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
143 lines (133 loc) · 4.76 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
import com.typesafe.tools.mima.core._
import snapshot4s.BuildInfo.snapshot4sVersion
import aquascapebuild.AquascapeDirectives
Global / onChangedBuildSource := ReloadOnSourceChanges
// https://typelevel.org/sbt-typelevel/faq.html#what-is-a-base-version-anyway
ThisBuild / tlBaseVersion := "0.3" // your current series x.y
ThisBuild / organization := "com.github.zainab-ali"
ThisBuild / organizationName := "Zainab Ali"
ThisBuild / startYear := Some(2023)
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / developers := List(
tlGitHubDev("zainab-ali", "Zainab Ali")
)
// publish to s01.oss.sonatype.org (set to true to publish to oss.sonatype.org instead)
ThisBuild / sonatypeCredentialHost := xerial.sbt.Sonatype.sonatypeLegacy
// publish website from this branch
ThisBuild / tlSitePublishBranch := Some("main")
val Scala3 = "3.3.5"
ThisBuild / crossScalaVersions := Seq(Scala3)
ThisBuild / scalaVersion := Scala3 // the default Scala
lazy val root = tlCrossRootProject.aggregate(core)
ThisBuild / tlCiMimaBinaryIssueCheck := false
lazy val core = crossProject(JVMPlatform, JSPlatform)
.in(file("core"))
.settings(
name := "aquascape",
fork := true,
mimaPreviousArtifacts := Set.empty,
libraryDependencies ++= Seq(
"co.fs2" %%% "fs2-core" % "3.11.0",
"co.fs2" %%% "fs2-io" % "3.11.0",
"org.creativescala" %%% "doodle-core" % "0.27.0",
"org.typelevel" %%% "cats-core" % "2.13.0",
"org.typelevel" %%% "cats-effect" % "3.5.7",
"org.scalameta" %%% "munit" % "1.0.4" % Test,
"org.typelevel" %%% "cats-effect-testkit" % "3.5.7" % Test,
"org.typelevel" %%% "munit-cats-effect" % "2.0.0" % Test,
"com.siriusxm" %%% "snapshot4s-munit" % snapshot4sVersion % Test
),
buildInfoKeys := Seq[BuildInfoKey](ThisBuild / baseDirectory),
buildInfoPackage := "aquascape"
)
.jvmSettings(
libraryDependencies ++= Seq(
"org.creativescala" %% "doodle-java2d" % "0.27.0",
"com.monovore" %% "decline" % "2.5.0"
)
)
.jsSettings(
Test / fork := false,
Test / scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.CommonJSModule)
},
libraryDependencies += ("org.creativescala" %%% "doodle-svg" % "0.27.0")
.exclude(
"com.lihaoyi",
"sourcecode_sjs1_3"
), // Both doodle-svg and snapshot4s include sourcecode.
mimaPreviousArtifacts := Set.empty
)
.enablePlugins(BuildInfoPlugin, Snapshot4sPlugin)
lazy val examples = project
.in(file("examples"))
.settings(
Test / scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.CommonJSModule)
},
libraryDependencies ++= Seq(
("org.creativescala" %%% "doodle-svg" % "0.27.0")
.exclude(
"com.lihaoyi",
"sourcecode_sjs1_3"
), // Both doodle-svg and scalameta include sourcecode.
("org.scalameta" %%% "scalameta" % "4.9.9" % Compile)
.cross(CrossVersion.for3Use2_13),
("org.scalameta" %% "scalafmt-core" % "3.8.3" % Compile)
.cross(CrossVersion.for3Use2_13),
"org.scala-js" %%% "scalajs-dom" % "2.8.0",
"org.typelevel" %%% "cats-effect-testkit" % "3.5.7",
"org.scalameta" %%% "munit" % "1.0.4" % Test,
"org.typelevel" %%% "munit-cats-effect" % "2.0.0" % Test,
("com.siriusxm" %%% "snapshot4s-munit" % snapshot4sVersion % Test)
.exclude(
"com.lihaoyi",
"sourcecode_sjs1_3"
) // Both snapshot4s and scalameta include sourcecode.
)
)
.dependsOn(core.js)
.enablePlugins(ScalaJSPlugin, NoPublishPlugin, Snapshot4sPlugin)
import laika.format._
import laika.ast.Path.Root
import laika.helium.config.{ThemeNavigationSection, TextLink}
lazy val docs = project
.in(file("site"))
.dependsOn(core.jvm)
.settings(
mdocVariables += ("SCALAJS_VERSION" -> scalaJSVersion),
tlSiteKeepFiles := false,
tlSiteHelium := tlSiteHelium.value.site
.mainNavigation(
prependLinks = Seq(
ThemeNavigationSection(
"About",
TextLink.internal(Root / "README.md", "About aquascape")
)
)
)
.site
.internalCSS(Root / "main.css")
.site
.internalJS(Root / "main.js")
.site
// Add highlight.js for code examples
.internalJS(Root / "highlight.min.js")
.site
.internalJS(Root / "aquascape.js")
.site
.internalCSS(Root / "a11y-dark.min.css"),
laikaExtensions += AquascapeDirectives,
// Add examples JS
Laika / sourceDirectories += (examples / Compile / fastOptJS / artifactPath).value
.getParentFile() / s"${(examples / moduleName).value}-fastopt",
tlSite := Def
.sequential(
Compile / clean,
examples / Compile / fastOptJS,
mdoc.toTask(""),
laikaSite
)
.value
)
.enablePlugins(TypelevelSitePlugin, NoPublishPlugin)