forked from outwatch/outwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
169 lines (157 loc) · 5.44 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
Global / onChangedBuildSource := ReloadOnSourceChanges
inThisBuild(
Seq(
organization := "io.github.outwatch",
scalaVersion := crossScalaVersions.value.last,
crossScalaVersions := Seq("2.13.13", "3.3.3"),
licenses += ("Apache 2", url("https://www.apache.org/licenses/LICENSE-2.0.txt")),
homepage := Some(url("https://outwatch.github.io/")),
scmInfo := Some(
ScmInfo(
url("https://github.com/outwatch/outwatch"),
"scm:git:[email protected]:outwatch/outwatch.git",
Some("scm:git:[email protected]:outwatch/outwatch.git"),
),
),
pomExtra :=
<developers>
<developer>
<id>jk</id>
<name>Johannes Karoff</name>
<url>https://github.com/cornerman</url>
</developer>
<developer>
<id>fx</id>
<name>Felix Dietze</name>
<url>https://github.com/fdietze</url>
</developer>
<developer>
<id>ltj</id>
<name>Luka Jacobowitz</name>
<url>https://github.com/LukaJCB</url>
</developer>
</developers>,
),
)
val jsdomVersion = "13.2.0"
val colibriVersion = "0.8.6"
val isDotty = Def.setting(CrossVersion.partialVersion(scalaVersion.value).exists(_._1 == 3))
lazy val commonSettings = Seq(
useYarn := true,
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % "3.2.18" % Test,
),
Test / scalacOptions --= Seq("-Xfatal-warnings"), // allow usage of deprecated calls in tests
libraryDependencies ++= (if (isDotty.value) Nil
else
Seq(
compilerPlugin(("org.typelevel" %% "kind-projector" % "0.13.3").cross(CrossVersion.full)),
)),
)
lazy val outwatchRepairDom = project
.in(file("repairdom"))
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(outwatch)
.settings(commonSettings)
.settings(
name := "outwatch-repairdom",
)
lazy val outwatchSnabbdom = project
.in(file("snabbdom"))
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.settings(commonSettings)
.settings(
name := "outwatch-snabbdom",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.8.0",
),
Compile / npmDependencies ++= Seq(
"snabbdom" -> "github:outwatch/snabbdom.git#semver:0.7.5",
),
)
lazy val outwatch = project
.in(file("outwatch"))
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(outwatchSnabbdom)
.settings(commonSettings)
.settings(
name := "outwatch",
libraryDependencies ++= Seq(
"com.raquo" %%% "domtypes" % "0.15.3",
"com.github.cornerman" %%% "colibri" % colibriVersion,
"com.github.cornerman" %%% "colibri-jsdom" % colibriVersion,
),
)
lazy val tests = project
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(outwatchRepairDom)
.settings(commonSettings)
.settings(
publish / skip := true,
Test / requireJsDomEnv := true,
installJsdom / version := jsdomVersion,
libraryDependencies ++= Seq(
"com.github.cornerman" %%% "colibri-reactive" % colibriVersion % Test,
),
)
lazy val bench = project
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(outwatch)
.settings(
publish / skip := true,
scalaJSUseMainModuleInitializer := true,
resolvers += "jitpack" at "https://jitpack.io",
libraryDependencies ++= Seq(
"com.github.fdietze.bench" %%% "bench" % "d411db1",
),
Compile / scalaJSStage := FullOptStage,
useYarn := true,
Compile / npmDependencies ++= Seq(
"jsdom" -> jsdomVersion,
),
)
lazy val jsdocs = project
.disablePlugins(TpolecatPlugin)
.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin)
.dependsOn(outwatch)
.settings(
webpackBundlingMode := BundlingMode.LibraryOnly(),
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.8.0",
"com.github.cornerman" %%% "colibri-airstream" % colibriVersion,
"com.github.cornerman" %%% "colibri-zio" % colibriVersion,
"com.github.cornerman" %%% "colibri-fs2" % colibriVersion,
"io.github.cquiroz" %%% "scala-java-time" % "2.4.0-M1",
"io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.4.0-M1",
),
libraryDependencies ++= (if (isDotty.value) Nil
else Seq("com.github.cornerman" %%% "colibri-rx" % colibriVersion)),
Compile / npmDependencies ++= Seq(
"js-beautify" -> "1.14.0",
),
)
lazy val docs = project
.in(file("outwatch-docs")) // important: it must not be docs/
.disablePlugins(TpolecatPlugin)
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(
test / skip := true,
publish / skip := true,
moduleName := "outwatch-docs",
mdocJS := Some(jsdocs),
mdocJSLibraries := (jsdocs / Compile / fullOptJS / webpack).value,
mdocVariables := Map(
/* TODO: "SCALAJSVERSION" -> scalaJSVersions.current, */
"VERSION" -> version.value,
"REPOURL" -> "https://github.com/outwatch/outwatch/blob/master",
"js-mount-node" -> "docPreview",
),
)
lazy val root = project
.in(file("."))
.settings(
name := "outwatch-root",
publish / skip := true,
)
.aggregate(outwatch, outwatchSnabbdom, outwatchRepairDom, tests, bench)