-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
54 lines (43 loc) · 1.94 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
name := "tangerine"
version := "1.1.0"
ThisBuild / scalaVersion := "3.4.0"
fork := true
scalacOptions ++= Seq("-deprecation", "-unchecked", "-Wunused:all", "-rewrite", "-source", "3.4-migration")
lazy val jfxVersion = "21.0.2"
lazy val jfxClassifier = settingKey[String]("jfxClassifier")
jfxClassifier := {
if (scala.util.Properties.isWin) "win"
else if (scala.util.Properties.isLinux) "linux"
else if (scala.util.Properties.isMac) "mac"
else throw new IllegalStateException(s"Unknown OS: ${scala.util.Properties.osName}")
}
libraryDependencies ++= Seq(
"com.lihaoyi" %% "sourcecode" % "0.3.1",
"com.github.pathikrit" %% "better-files" % "3.9.2",
//"com.beachape" %% "enumeratum" % "1.5.13",
"org.openjfx" % "javafx-graphics" % jfxVersion % "provided" classifier jfxClassifier.value,
"org.openjfx" % "javafx-controls" % jfxVersion % "provided" classifier jfxClassifier.value,
"org.openjfx" % "javafx-base" % jfxVersion % "provided" classifier jfxClassifier.value,
"org.controlsfx" % "controlsfx" % "11.2.1" % "provided",
)
lazy val moduleJars = taskKey[Seq[(Attributed[File], java.lang.module.ModuleDescriptor)]]("moduleJars")
moduleJars := {
val attributedJars = (Compile/dependencyClasspathAsJars).value.filterNot(_.metadata(moduleID.key).organization == "org.scala-lang")
val modules = attributedJars.flatMap { aj =>
try {
val module = java.lang.module.ModuleFinder.of(aj.data.toPath).findAll().iterator.next.descriptor
Some(aj -> module)
} catch { case _: java.lang.module.FindException => None }
}
modules
}
javaOptions ++= {
val modules = moduleJars.value
Seq(
"--add-modules=" + modules.map(_._2.name).mkString(","),
"--module-path=" + modules.map(_._1.data.getAbsolutePath).mkString(java.io.File.pathSeparator)
)
}
(reStart/javaOptions) += "--add-opens=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED"
reStart/mainClass := Some("expenser.ui.DevAppReloader")
javacOptions := javaOptions.value