Skip to content

Commit f469eff

Browse files
committed
Update RuntimeHintsAgentPlugin to use the native image code path
RuntimeHintsAgentPlugin purpose is to verify that the reflective invocations expected match the ones performed. gh-30242 introduces a code path where the reflective invocation is skipped when running on native. This issue set the system property "org.graalvm.nativeimage.imagecode" to "runtime" when running runtime tests with the agent in order to make sure the code path tested for those tests is the native one. Closes gh-30422
1 parent 69cde11 commit f469eff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

buildSrc/src/main/java/org/springframework/build/hint/RuntimeHintsAgentPlugin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
2626
* {@link Plugin} that configures the {@code RuntimeHints} Java agent to test tasks.
2727
*
2828
* @author Brian Clozel
29+
* @author Sebastien Deleuze
2930
*/
3031
public class RuntimeHintsAgentPlugin implements Plugin<Project> {
3132

@@ -45,6 +46,7 @@ public void apply(Project project) {
4546
});
4647
test.include("**/*Tests.class", "**/*Test.class");
4748
test.systemProperty("java.awt.headless", "true");
49+
test.systemProperty("org.graalvm.nativeimage.imagecode", "runtime");
4850
});
4951
project.afterEvaluate(p -> {
5052
Jar jar = project.getRootProject().project("spring-core-test").getTasks().withType(Jar.class).named("jar").get();

0 commit comments

Comments
 (0)