@@ -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
0 commit comments