@@ -110,15 +110,13 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
110
110
}
111
111
)
112
112
113
- private def buildLocal (
114
- targetDirectory : File ,
115
- binaryName : String ,
116
- nativeImageCommand : String ,
117
- className : String ,
118
- classpathJars : Seq [File ],
119
- extraOptions : Seq [String ],
120
- log : ProcessLogger
121
- ): File = {
113
+ private def buildLocal (targetDirectory : File ,
114
+ binaryName : String ,
115
+ nativeImageCommand : String ,
116
+ className : String ,
117
+ classpathJars : Seq [File ],
118
+ extraOptions : Seq [String ],
119
+ log : ProcessLogger ): File = {
122
120
targetDirectory.mkdirs()
123
121
val command = {
124
122
val nativeImageArguments = {
@@ -128,8 +126,7 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
128
126
IO .withTemporaryFile(" native-image-classpath" , " .txt" , keepFile = true ) { file =>
129
127
IO .write(file, s " --class-path $classpath" )
130
128
Seq (s " @ ${file.absolutePath}" )
131
- }
132
- else Seq (" --class-path" , classpath)
129
+ } else Seq (" --class-path" , classpath)
133
130
cpArgs ++ Seq (s " -H:Name= $binaryName" ) ++ extraOptions ++ Seq (className)
134
131
}
135
132
Seq (nativeImageCommand) ++ nativeImageArguments
@@ -141,18 +138,16 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
141
138
}
142
139
}
143
140
144
- private def buildInDockerContainer (
145
- targetDirectory : File ,
146
- binaryName : String ,
147
- className : String ,
148
- classpathJars : Seq [(File , String )],
149
- extraOptions : Seq [String ],
150
- platformArch : Option [String ],
151
- dockerCommand : Seq [String ],
152
- resources : Seq [(File , String )],
153
- image : String ,
154
- streams : TaskStreams
155
- ): File = {
141
+ private def buildInDockerContainer (targetDirectory : File ,
142
+ binaryName : String ,
143
+ className : String ,
144
+ classpathJars : Seq [(File , String )],
145
+ extraOptions : Seq [String ],
146
+ platformArch : Option [String ],
147
+ dockerCommand : Seq [String ],
148
+ resources : Seq [(File , String )],
149
+ image : String ,
150
+ streams : TaskStreams ): File = {
156
151
import sys .process ._
157
152
stage(targetDirectory, classpathJars, resources, streams)
158
153
@@ -193,10 +188,8 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
193
188
*
194
189
* The passed in docker image must have GraalVM installed and on the PATH, including the gu utility.
195
190
*/
196
- def generateContainerBuildImage (
197
- baseImage : String ,
198
- platformArch : Option [String ] = None
199
- ): Def .Initialize [Task [Option [String ]]] =
191
+ def generateContainerBuildImage (baseImage : String ,
192
+ platformArch : Option [String ] = None ): Def .Initialize [Task [Option [String ]]] =
200
193
Def .task {
201
194
import sys .process ._
202
195
@@ -238,6 +231,7 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
238
231
" build" ,
239
232
" --platform" ,
240
233
platformValue,
234
+ " --load" ,
241
235
" --label" ,
242
236
s " com.typesafe.sbt.packager.graalvmnativeimage.platform= $platformValue" ,
243
237
" -t" ,
@@ -258,12 +252,10 @@ object GraalVMNativeImagePlugin extends AutoPlugin {
258
252
Some (imageName)
259
253
}
260
254
261
- private def stage (
262
- targetDirectory : File ,
263
- classpathJars : Seq [(File , String )],
264
- resources : Seq [(File , String )],
265
- streams : TaskStreams
266
- ): File = {
255
+ private def stage (targetDirectory : File ,
256
+ classpathJars : Seq [(File , String )],
257
+ resources : Seq [(File , String )],
258
+ streams : TaskStreams ): File = {
267
259
val stageDir = targetDirectory / " stage"
268
260
val mappings = classpathJars ++ resources.map {
269
261
case (resource, path) => resource -> s " resources/ $path"
0 commit comments