Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kgston committed Aug 5, 2023
1 parent b48618f commit bb0faad
Showing 1 changed file with 33 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
}
)

private def buildLocal(targetDirectory: File,
binaryName: String,
nativeImageCommand: String,
className: String,
classpathJars: Seq[File],
extraOptions: Seq[String],
log: ProcessLogger): File = {
private def buildLocal(
targetDirectory: File,
binaryName: String,
nativeImageCommand: String,
className: String,
classpathJars: Seq[File],
extraOptions: Seq[String],
log: ProcessLogger
): File = {
targetDirectory.mkdirs()
val command = {
val nativeImageArguments = {
Expand All @@ -126,7 +128,8 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
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)
}
else Seq("--class-path", classpath)
cpArgs ++ Seq(s"-H:Name=$binaryName") ++ extraOptions ++ Seq(className)
}
Seq(nativeImageCommand) ++ nativeImageArguments
Expand All @@ -138,16 +141,18 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
}
}

private def buildInDockerContainer(targetDirectory: File,
binaryName: String,
className: String,
classpathJars: Seq[(File, String)],
extraOptions: Seq[String],
platformArch: Option[String],
dockerCommand: Seq[String],
resources: Seq[(File, String)],
image: String,
streams: TaskStreams): File = {
private def buildInDockerContainer(
targetDirectory: File,
binaryName: String,
className: String,
classpathJars: Seq[(File, String)],
extraOptions: Seq[String],
platformArch: Option[String],
dockerCommand: Seq[String],
resources: Seq[(File, String)],
image: String,
streams: TaskStreams
): File = {
import sys.process._
stage(targetDirectory, classpathJars, resources, streams)

Expand Down Expand Up @@ -188,8 +193,10 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
*
* The passed in docker image must have GraalVM installed and on the PATH, including the gu utility.
*/
def generateContainerBuildImage(baseImage: String,
platformArch: Option[String] = None): Def.Initialize[Task[Option[String]]] =
def generateContainerBuildImage(
baseImage: String,
platformArch: Option[String] = None
): Def.Initialize[Task[Option[String]]] =
Def.task {
import sys.process._

Expand Down Expand Up @@ -251,10 +258,12 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
Some(imageName)
}

private def stage(targetDirectory: File,
classpathJars: Seq[(File, String)],
resources: Seq[(File, String)],
streams: TaskStreams): File = {
private def stage(
targetDirectory: File,
classpathJars: Seq[(File, String)],
resources: Seq[(File, String)],
streams: TaskStreams
): File = {
val stageDir = targetDirectory / "stage"
val mappings = classpathJars ++ resources.map {
case (resource, path) => resource -> s"resources/$path"
Expand Down

0 comments on commit bb0faad

Please sign in to comment.