-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
64 lines (53 loc) · 1.73 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
import scala.scalanative.build.Mode
Global / onChangedBuildSource := ReloadOnSourceChanges
val V = new {
val Scala = "3.1.2"
}
lazy val exampleBackend =
projectMatrix
.in(file("example-backend"))
.nativePlatform(Seq(V.Scala))
.dependsOn(neutrino)
.defaultAxes(VirtualAxis.scalaABIVersion(V.Scala), VirtualAxis.native)
.settings(
nativeConfig := {
val conf = nativeConfig.value
conf
.withLinkingOptions(
conf.linkingOptions ++ Seq(
((ThisBuild / baseDirectory).value / "webview" / "webview.a").toString,
"-framework",
"WebKit"
)
)
.withEmbedResources(true)
},
Compile / resourceGenerators += Def.task {
val jsLinked = (exampleJS / Compile / fastLinkJS).value
val path =
(exampleJS / Compile / fastLinkJS / scalaJSLinkerOutputDirectory).value
val file = path / "main.js"
val dest =
(Compile / managedResourceDirectories).value.head / "app.js"
IO.copyFile(file, dest)
List(dest)
}
)
lazy val exampleFrontend =
projectMatrix
.in(file("example-frontend"))
.dependsOn(neutrino)
.jsPlatform(Seq(V.Scala))
.defaultAxes(VirtualAxis.scalaABIVersion(V.Scala), VirtualAxis.js)
.settings(scalaJSUseMainModuleInitializer := true)
.settings(libraryDependencies += "com.raquo" %%% "laminar" % "0.14.2")
lazy val exampleJS = exampleFrontend.js(V.Scala)
lazy val neutrino =
projectMatrix
.in(file("neutrino"))
.jsPlatform(Seq(V.Scala))
.nativePlatform(Seq(V.Scala))
.defaultAxes(VirtualAxis.scalaABIVersion(V.Scala))
.settings(
libraryDependencies += "com.lihaoyi" %%% "upickle" % "2.0.0"
)