From a26356ea56cdecf9cdf08eb4f106369145dba590 Mon Sep 17 00:00:00 2001 From: Albert Meltzer <7529386+kitbellew@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:29:11 -0800 Subject: [PATCH] SBT: native settings/plugins for native platform --- build.sbt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 4fa5dd8a58..44896ebe73 100644 --- a/build.sbt +++ b/build.sbt @@ -196,6 +196,8 @@ lazy val cli = crossProject(JVMPlatform, NativePlatform) ), scalacOptions ++= scalacJvmOptions.value, Compile / mainClass := Some("org.scalafmt.cli.Cli"), + ).nativeSettings( + nativeConfig ~= { _.withMode(Mode.releaseFull) }, nativeImageInstalled := isCI, nativeImageOptions ++= { // https://www.graalvm.org/22.3/reference-manual/native-image/guides/build-static-executables/ @@ -210,8 +212,7 @@ lazy val cli = crossProject(JVMPlatform, NativePlatform) case _ => Nil } }, - ).nativeSettings(scalaNativeConfig).dependsOn(core, dynamic) - .enablePlugins(NativeImagePlugin) + ).nativeEnablePlugins(NativeImagePlugin).dependsOn(core, dynamic) lazy val tests = crossProject(JVMPlatform, NativePlatform) .withoutSuffixFor(JVMPlatform).in(file("scalafmt-tests")).settings( @@ -327,5 +328,3 @@ lazy val communityTestsSettings: Seq[Def.Setting[_]] = Seq( javaOptions += "-Dfile.encoding=UTF8", buildInfoPackage := "org.scalafmt.tests", ) - -lazy val scalaNativeConfig = nativeConfig ~= { _.withMode(Mode.releaseFull) }