Skip to content

Commit

Permalink
fix handling long classpath for graalvm on windows (#1472)
Browse files Browse the repository at this point in the history
* fix handling long classpath for graalvm on windows

* scalafmt

Co-authored-by: Nepomuk Seiler <muuki88@users.noreply.github.com>
  • Loading branch information
OlegYch and muuki88 authored Nov 17, 2021
1 parent e7e24b8 commit 5b5e8d6
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
val command = {
val nativeImageArguments = {
val classpath = classpathJars.mkString(java.io.File.pathSeparator)
Seq("--class-path", classpath, s"-H:Name=$binaryName") ++ extraOptions ++ Seq(className)
val cpArgs =
if (scala.util.Properties.isWin)
IO.withTemporaryFile("native-image-classpath", ".txt", keepFile = true) { file =>
IO.write(file, s"--class-path $classpath")
Seq(s"@${file.absolutePath}")
}
else Seq("--class-path", classpath)
cpArgs ++ Seq(s"-H:Name=$binaryName") ++ extraOptions ++ Seq(className)
}
Seq(nativeImageCommand) ++ nativeImageArguments
}
Expand Down

0 comments on commit 5b5e8d6

Please sign in to comment.