Skip to content

Commit dc17d5e

Browse files
committed
Update nativeImageVersion to 24.0.2
1 parent 84cf4e2 commit dc17d5e

File tree

5 files changed

+40
-34
lines changed

5 files changed

+40
-34
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/setup-java@v5
2828
with:
2929
distribution: graalvm
30-
java-version: 21
30+
java-version: 24
3131
- uses: sbt/setup-sbt@v1
3232
- name: Setup Windows C++ toolchain
3333
uses: ilammy/msvc-dev-cmd@v1
@@ -36,14 +36,14 @@ jobs:
3636
if: ${{ matrix.jobtype == 1 }}
3737
shell: bash
3838
run: |
39-
export GRAALVM_HOME=$JAVA_HOME_21_X64
39+
export GRAALVM_HOME=$JAVA_HOME_24_X64
4040
export NATIVE_IMAGE_COMMAND=$GRAALVM_HOME/bin/native-image
4141
sbt ++2.12.x test plugin/scripted
4242
- name: sbt test plugin/scripted (2)
4343
if: ${{ matrix.jobtype == 2 }}
4444
shell: bash
4545
run: |
46-
export GRAALVM_HOME=$JAVA_HOME_21_X64
46+
export GRAALVM_HOME=$JAVA_HOME_24_X64
4747
export NATIVE_IMAGE_COMMAND=$GRAALVM_HOME/bin/native-image
4848
sbt ++3.x test plugin/scripted
4949
check:

plugin/src/main/scala/sbtnativeimage/NativeImagePlugin.scala

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ object NativeImagePlugin extends AutoPlugin {
6565
lazy val nativeImageGraalHome: TaskKey[NioPath] = taskKey[NioPath](
6666
"Path to GraalVM home directory."
6767
)
68+
@transient
6869
lazy val nativeImageCommand: TaskKey[Seq[String]] = taskKey[Seq[String]](
6970
"The command arguments to launch the GraalVM native-image binary."
7071
)
72+
@transient
7173
lazy val nativeImageTestCommand: TaskKey[Seq[String]] =
7274
taskKey[Seq[String]](
7375
"The command arguments to launch the GraalVM native-image binary of tests."
@@ -105,6 +107,7 @@ object NativeImagePlugin extends AutoPlugin {
105107
lazy val nativeImageTestRun: InputKey[Unit] = inputKey[Unit](
106108
"Run the generated native-image binary for tests without linking."
107109
)
110+
@transient
108111
lazy val nativeImageTestRunOptions: TaskKey[Seq[String]] =
109112
taskKey[Seq[String]](
110113
"Extra command-line arguments that should be forwarded to the tests."
@@ -118,9 +121,11 @@ object NativeImagePlugin extends AutoPlugin {
118121
settingKey[ArtifactPath](
119122
"The binary that is produced by tests native-image"
120123
)
124+
@transient
121125
lazy val nativeImageOptions: TaskKey[Seq[String]] = taskKey[Seq[String]](
122126
"Extra command-line arguments that should be forwarded to the native-image optimizer."
123127
)
128+
@transient
124129
lazy val nativeImageTestOptions: TaskKey[Seq[String]] =
125130
taskKey[Seq[String]](
126131
"Extra command-line arguments that should be forwarded to the native-image optimizer."
@@ -149,16 +154,11 @@ object NativeImagePlugin extends AutoPlugin {
149154
out.toFile
150155
}
151156

152-
override lazy val projectSettings: Seq[Def.Setting[?]] = List(
153-
libraryDependencies += "org.scalameta" % "svm-subs" % "101.0.0",
154-
NativeImage / target :=
155-
(Compile / target).value / "native-image",
156-
NativeImageTest / target :=
157-
(Test / target).value / "native-image-test",
158-
NativeImageInternal / target :=
159-
(Compile / target).value / "native-image-internal",
160-
NativeImageTestInternal / target :=
161-
(Test / target).value / "native-image-test-internal",
157+
override lazy val globalSettings: Seq[Def.Setting[?]] = List(
158+
nativeImageJvm := "graalvm-community",
159+
nativeImageVersion := "24.0.2",
160+
nativeImageJvmIndex := "cs",
161+
nativeImageAgentMerge := false,
162162
nativeImageReady := {
163163
val s = streams.value
164164

@@ -173,9 +173,32 @@ object NativeImagePlugin extends AutoPlugin {
173173
this.alertUser(s, "Native image of tests is ready!")
174174
}
175175
},
176-
nativeImageJvm := "graalvm-java17",
177-
nativeImageJvmIndex := "cs",
178-
nativeImageVersion := "22.3.1",
176+
nativeImageInstalled :=
177+
Def
178+
.settingDyn {
179+
val installed =
180+
"true"
181+
.equalsIgnoreCase(System.getProperty("native-image-installed")) ||
182+
"true"
183+
.equalsIgnoreCase(System.getenv("NATIVE_IMAGE_INSTALLED")) ||
184+
"true"
185+
.equalsIgnoreCase(System.getProperty("graalvm-installed")) ||
186+
"true".equalsIgnoreCase(System.getenv("GRAALVM_INSTALLED"))
187+
Def.setting(installed)
188+
}
189+
.value
190+
)
191+
192+
override lazy val projectSettings: Seq[Def.Setting[?]] = List(
193+
libraryDependencies += "org.scalameta" % "svm-subs" % "101.0.0",
194+
NativeImage / target :=
195+
(Compile / target).value / "native-image",
196+
NativeImageTest / target :=
197+
(Test / target).value / "native-image-test",
198+
NativeImageInternal / target :=
199+
(Compile / target).value / "native-image-internal",
200+
NativeImageTestInternal / target :=
201+
(Test / target).value / "native-image-test-internal",
179202
NativeImage / name := name.value,
180203
NativeImageTest / name :=
181204
(Test / name).value,
@@ -195,20 +218,6 @@ object NativeImagePlugin extends AutoPlugin {
195218
out
196219
}
197220
},
198-
nativeImageInstalled :=
199-
Def
200-
.settingDyn {
201-
val installed =
202-
"true"
203-
.equalsIgnoreCase(System.getProperty("native-image-installed")) ||
204-
"true"
205-
.equalsIgnoreCase(System.getenv("NATIVE_IMAGE_INSTALLED")) ||
206-
"true"
207-
.equalsIgnoreCase(System.getProperty("graalvm-installed")) ||
208-
"true".equalsIgnoreCase(System.getenv("GRAALVM_INSTALLED"))
209-
Def.setting(installed)
210-
}
211-
.value,
212221
nativeImageGraalHome :=
213222
Def
214223
.taskDyn {
@@ -284,7 +293,6 @@ object NativeImagePlugin extends AutoPlugin {
284293
nativeImageTestCommand := nativeImageCommand.value,
285294
nativeImageAgentOutputDir := target.value / "native-image-configs",
286295
nativeImageTestAgentOutputDir := nativeImageAgentOutputDir.value,
287-
nativeImageAgentMerge := false,
288296
nativeImageTestAgentMerge := nativeImageAgentMerge.value,
289297
nativeImageRunAgent := {
290298
val _ = nativeImageCommand.value

plugin/src/sbt-test/sbt-native-image/agent-test/build.sbt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ lazy val example = project
33
scalaVersion := "2.12.21",
44
Compile / mainClass := Some("example.Hello6"),
55
nativeImageTestOptions ++= Seq(
6-
s"-H:ReflectionConfigurationFiles=${target.value / "native-image-configs" / "reflect-config.json"}",
76
"--initialize-at-build-time=scala.collection.immutable.VM",
87
),
98
Test / mainClass := Some("org.scalatest.tools.Runner"),
10-
nativeImageTestRunOptions ++= Seq("-o", "-R", classDirectory.in(Test).value.absolutePath),
9+
nativeImageTestRunOptions ++= Seq("-o", "-R", (Test / classDirectory).value.absolutePath),
1110
nativeImageCommand := List(
1211
sys.env.getOrElse(
1312
"NATIVE_IMAGE_COMMAND",

plugin/src/sbt-test/sbt-native-image/agent/build.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ lazy val example = project
44
Compile / mainClass := Some("example.Hello3"),
55
nativeImageOptions ++= Seq(
66
"--no-fallback",
7-
s"-H:ReflectionConfigurationFiles=${ target.value / "native-image-configs" / "reflect-config.json" }"
87
),
98
nativeImageCommand := List(
109
sys.env.getOrElse(
File renamed without changes.

0 commit comments

Comments
 (0)