File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
cli/src/main/scala/scala/cli/commands/package0
integration/src/test/scala/scala/cli/integration Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -268,9 +268,16 @@ object Package extends ScalaCommand[PackageOptions] with BuildCommandHelpers {
268
268
case _ if Properties .isWin => " app.bat"
269
269
case _ => " app"
270
270
}
271
+ val output = outputOpt.map {
272
+ case path
273
+ if packageType == PackageType .GraalVMNativeImage
274
+ && Properties .isWin && ! path.endsWith(" .exe" ) =>
275
+ s " $path.exe " // graalvm-native-image requires .exe extension on Windows
276
+ case path => path
277
+ }
271
278
272
279
val packageOutput = build.options.notForBloopOptions.packageOptions.output
273
- val dest = outputOpt .orElse(packageOutput)
280
+ val dest = output .orElse(packageOutput)
274
281
.orElse {
275
282
build.sources.defaultMainClass
276
283
.map(n => n.drop(n.lastIndexOf('.' ) + 1 ))
Original file line number Diff line number Diff line change @@ -808,7 +808,8 @@ abstract class PackageTestDefinitions(val scalaVersionOpt: Option[String])
808
808
809
809
test(" native image" ) {
810
810
val message = " Hello from native-image"
811
- val dest =
811
+ val dest = " hello"
812
+ val actualDest =
812
813
if (Properties .isWin) " hello.exe"
813
814
else " hello"
814
815
val inputs = TestInputs (
@@ -837,11 +838,11 @@ abstract class PackageTestDefinitions(val scalaVersionOpt: Option[String])
837
838
stdout = os.Inherit
838
839
)
839
840
840
- expect(os.isFile(root / dest ))
841
+ expect(os.isFile(root / actualDest ))
841
842
842
843
// FIXME Check that dest is indeed a binary?
843
844
844
- val res = os.proc(root / dest ).call(cwd = root)
845
+ val res = os.proc(root / actualDest ).call(cwd = root)
845
846
val output = res.out.trim()
846
847
expect(output == message)
847
848
}
You can’t perform that action at this time.
0 commit comments