-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
74 lines (66 loc) · 2.23 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
import BuildConstants._
import pl.project13.scala.sbt.JmhPlugin
import sbt.{Def, _}
val bootstrapMinJs: NameFilter = "**/bootstrap.min.js"
val bootstrapMinCss: NameFilter = "**/bootstrap.min.css"
val bootstrapFilters: NameFilter = bootstrapMinCss | bootstrapMinJs
def unpackjar(jar: File, to: File, filter: NameFilter): File = {
val files: Set[File] = IO.unzip(jar, to, filter)
println(s"Processing $jar and unzipping to $to")
files foreach println
jar
}
lazy val commonSettings: Seq[Def.SettingsDefinition] = Seq(
organization := org,
scalaVersion := scalaVer,
version := buildVer,
fork := true,
// add local maven repository to lookup libs (custom javafx)
resolvers ++=
Seq(Resolver.mavenLocal)
)
lazy val bench = (project in file("bench"))
.enablePlugins(JmhPlugin)
.settings(commonSettings: _*)
.settings(name := "bench",
fork := true)
.dependsOn(model)
lazy val model = (project in file("model/")).
enablePlugins(ScalaJSPlugin).
settings(commonSettings: _*).
settings(name := "model"
, fork := false
)
lazy val jfx = (project in file("jfx/")).
settings(commonSettings: _*).
settings(name := "jfx",
libraryDependencies ++=
Seq(
"org.openjfx" % "javafx-graphics" % jfxVer classifier "mac"
, "org.openjfx" % "javafx-base" % jfxVer
, "org.openjfx" % "javafx-base" % jfxVer classifier "mac"
, "org.scalactic" %% "scalactic" % "3.0.8"
, "org.scalatest" %% "scalatest" % "3.0.8" % "test")
).dependsOn(model)
lazy val js = (project in file("js/")).
enablePlugins(ScalaJSPlugin).
settings(commonSettings: _*).
settings(
name := "js"
, libraryDependencies ++=
Seq("org.scala-js" %%% "scalajs-dom" % "1.0.0"
, "org.webjars" % "bootstrap" % "4.3.1")
, fork := false
, resourceGenerators in Compile += Def.task {
val jar = (update in Compile).value
.select(configurationFilter("compile"))
.filter(_.name.contains("bootstrap"))
.head
val to = (target in Compile).value
unpackjar(jar, to, bootstrapFilters)
Seq.empty[File]
}.taskValue
).dependsOn(model)
lazy val plasma = (project in file(".")).
settings(commonSettings: _*).
settings(name := "plasma").aggregate(model, js, jfx, bench)