Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ThisBuild / semanticdbEnabled := true
ThisBuild / scalaVersion := "3.6.4"
lazy val scalaV = "3.6.4"
ThisBuild / scalaVersion := scalaV

resolvers +=
"Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots"
Expand All @@ -12,6 +13,14 @@ addCommandAlias("fixAll", "scalafixAll; scalafmtAll")
def isDevBuild: Boolean =
sys.env.get("DEV_BUILD").exists(s => s != "0" && s != "false")

lazy val baseGraalOptions = Seq(
// If running on Scala <3.8 and JDK >=24, we need to allow unsafe memory access.
// Otherwise, we get annoying warnings on startup.
// https://github.com/scala/scala3/issues/9013
// Remove this after moving to Scala 3.8
if (scalaV.split('.')(1).toInt < 8) Some("-J--sun-misc-unsafe-memory-access=allow") else None,
).flatten

lazy val root = (project in file("."))
.enablePlugins(
BuildInfoPlugin,
Expand Down Expand Up @@ -45,5 +54,8 @@ lazy val root = (project in file("."))
// GraalVM settings
Compile / mainClass := Some("eu.neverblink.jelly.cli.App"),
// Do a fast build if it's a dev build
graalVMNativeImageOptions := (if (isDevBuild) Seq("-Ob") else Seq("--emit build-report")),
graalVMNativeImageOptions := (
if (isDevBuild) Seq("-Ob")
else Seq("--emit build-report")
) ++ baseGraalOptions,
)
Loading