diff --git a/.scalafmt.conf b/.scalafmt.conf index 405fdf3..bbbaa48 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,5 @@ -version = "2.7.5" +version = "3.11.0" +runner.dialect = scala212source3 assumeStandardLibraryStripMargin = true docstrings.style = Asterisk docstrings.wrap = "yes" diff --git a/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala b/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala index d0d1dc6..2007944 100644 --- a/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala +++ b/plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala @@ -172,13 +172,15 @@ object NativeImagePlugin extends AutoPlugin { Def .settingDyn { val installed = - "true" - .equalsIgnoreCase(System.getProperty("native-image-installed")) || - "true" - .equalsIgnoreCase(System.getenv("NATIVE_IMAGE_INSTALLED")) || - "true" - .equalsIgnoreCase(System.getProperty("graalvm-installed")) || - "true".equalsIgnoreCase(System.getenv("GRAALVM_INSTALLED")) + "true".equalsIgnoreCase( + System.getProperty("native-image-installed") + ) || + "true".equalsIgnoreCase( + System.getenv("NATIVE_IMAGE_INSTALLED") + ) || + "true".equalsIgnoreCase( + System.getProperty("graalvm-installed") + ) || "true".equalsIgnoreCase(System.getenv("GRAALVM_INSTALLED")) Def.setting(installed) } .value @@ -186,21 +188,16 @@ object NativeImagePlugin extends AutoPlugin { override lazy val projectSettings: Seq[Def.Setting[?]] = List( libraryDependencies += "org.scalameta" % "svm-subs" % "101.0.0", - NativeImage / target := - (Compile / target).value / "native-image", - NativeImageTest / target := - (Test / target).value / "native-image-test", + NativeImage / target := (Compile / target).value / "native-image", + NativeImageTest / target := (Test / target).value / "native-image-test", NativeImageInternal / target := (Compile / target).value / "native-image-internal", NativeImageTestInternal / target := (Test / target).value / "native-image-test-internal", NativeImage / name := name.value, - NativeImageTest / name := - (Test / name).value, - NativeImage / mainClass := - (Compile / mainClass).value, - NativeImageTest / mainClass := - (Test / mainClass).value, + NativeImageTest / name := (Test / name).value, + NativeImage / mainClass := (Compile / mainClass).value, + NativeImageTest / mainClass := (Test / mainClass).value, nativeImageOptions := List(), nativeImageTestOptions := nativeImageOptions.value, nativeImageTestRunOptions := List(), @@ -298,7 +295,8 @@ object NativeImagePlugin extends AutoPlugin { else "config-output-dir" val agentOption = - s"-agentlib:native-image-agent=$agentConfig=${nativeImageAgentOutputDir.value}" + s"-agentlib:native-image-agent=$agentConfig=${nativeImageAgentOutputDir + .value}" val tpr = thisProjectRef.value val settings = Seq( tpr / Compile / run / fork := true, @@ -328,7 +326,8 @@ object NativeImagePlugin extends AutoPlugin { else "config-output-dir" val agentOption = - s"-agentlib:native-image-agent=$agentConfig=${nativeImageTestAgentOutputDir.value}" + s"-agentlib:native-image-agent=$agentConfig=${nativeImageTestAgentOutputDir + .value}" val options = (Test / run / javaOptions).value ++ Seq(agentOption) val conv0 = fileConverter.value @@ -422,11 +421,10 @@ object NativeImagePlugin extends AutoPlugin { }, nativeImage := Def.uncached { - val _ = - ( - (Compile / products).value, - (Compile / compile / compileInputs2).value - ) + val _ = ( + (Compile / products).value, + (Compile / compile / compileInputs2).value + ) val main = (NativeImage / mainClass).value val binaryName: ArtifactPath = nativeImageOutput.value val cp = (Compile / fullClasspath).value.map(_.data) @@ -569,9 +567,9 @@ object NativeImagePlugin extends AutoPlugin { try { manifestPath.relativize(path).toString } catch { - //java.lang.IllegalArgumentException: 'other' has different root - //this happens if the dependency jar resides on a different drive then the manifest, i.e. C:\Coursier\Cache and D:\myapp\target - //copy dependency next to manifest as fallback + // java.lang.IllegalArgumentException: 'other' has different root + // this happens if the dependency jar resides on a different drive then the manifest, i.e. C:\Coursier\Cache and D:\myapp\target + // copy dependency next to manifest as fallback case _: IllegalArgumentException => import java.nio.file.Files import java.nio.file.StandardCopyOption