Skip to content

Commit

Permalink
SBT: native-image settings/plugins for JVM only
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Nov 20, 2024
1 parent 8b1faed commit 3d80b3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ lazy val cli = crossProject(JVMPlatform, NativePlatform)
),
scalacOptions ++= scalacJvmOptions.value,
Compile / mainClass := Some("org.scalafmt.cli.Cli"),
).jvmSettings(
nativeImageInstalled := isCI,
nativeImageOptions ++= {
// https://www.graalvm.org/22.3/reference-manual/native-image/guides/build-static-executables/
Expand All @@ -211,7 +212,7 @@ lazy val cli = crossProject(JVMPlatform, NativePlatform)
}
},
).nativeSettings(scalaNativeConfig).dependsOn(core, dynamic)
.enablePlugins(NativeImagePlugin)
.jvmEnablePlugins(NativeImagePlugin)

lazy val tests = crossProject(JVMPlatform, NativePlatform)
.withoutSuffixFor(JVMPlatform).in(file("scalafmt-tests")).settings(
Expand Down

0 comments on commit 3d80b3e

Please sign in to comment.