mirror of https://github.com/sbt/sbt.git
Fix native-image: create target/bin before building sbtw
This commit is contained in:
parent
40a1cfd6d3
commit
3924567ee1
12
build.sbt
12
build.sbt
|
|
@ -967,6 +967,7 @@ def scriptedTask(launch: Boolean): Def.Initialize[InputTask[Unit]] = Def.inputTa
|
|||
}
|
||||
|
||||
lazy val publishLauncher = TaskKey[Unit]("publish-launcher")
|
||||
val createSbtwBinDir = taskKey[Unit]("Create sbtw target/bin before native-image")
|
||||
|
||||
lazy val sbtwProj = (project in file("sbtw"))
|
||||
.enablePlugins(NativeImagePlugin)
|
||||
|
|
@ -980,7 +981,16 @@ lazy val sbtwProj = (project in file("sbtw"))
|
|||
libraryDependencies += "com.github.scopt" %% "scopt" % "4.1.0",
|
||||
nativeImageVersion := "23.0",
|
||||
nativeImageJvm := "graalvm-java23",
|
||||
nativeImageOutput := (target.value / "bin" / "sbtw").toPath.toFile,
|
||||
createSbtwBinDir := {
|
||||
val d = (target.value / "bin").toPath
|
||||
if (!Files.exists(d)) Files.createDirectories(d)
|
||||
},
|
||||
Compile / nativeImage := (Compile / nativeImage).dependsOn(createSbtwBinDir).value,
|
||||
nativeImageOutput := {
|
||||
val outputDir = (target.value / "bin").toPath
|
||||
if (!Files.exists(outputDir)) Files.createDirectories(outputDir)
|
||||
outputDir.resolve("sbtw").toFile
|
||||
},
|
||||
nativeImageOptions ++= Seq(
|
||||
"--no-fallback",
|
||||
s"--initialize-at-run-time=sbtw",
|
||||
|
|
|
|||
Loading…
Reference in New Issue