Expand hints conditions support in RuntimeHints
Prior to this commit, the hints conditions were only supported for the `TypeHint` case. GraalVM generally expanded this concept to all hints and we should do the same. Right now, only the `typeReachable` condition is available but we should design for possible future additions. This commit introduces a new `ConditionalHint` contract implemented by all hints compatible with this approach. The condition information is also used in all configuration writers as a result. Closes gh-28126
This commit is contained in:
@@ -31,6 +31,7 @@ import org.springframework.aot.generate.GeneratedMethods;
|
||||
import org.springframework.aot.generate.InMemoryGeneratedFiles;
|
||||
import org.springframework.aot.generate.MethodGenerator;
|
||||
import org.springframework.aot.generate.MethodReference;
|
||||
import org.springframework.aot.hint.ResourcePatternHint;
|
||||
import org.springframework.aot.test.generator.compile.Compiled;
|
||||
import org.springframework.aot.test.generator.compile.TestCompiler;
|
||||
import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution;
|
||||
@@ -90,6 +91,7 @@ class ConfigurationClassPostProcessorAotContributionTests {
|
||||
assertThat(generationContext.getRuntimeHints().resources().resourcePatterns())
|
||||
.singleElement()
|
||||
.satisfies(resourceHint -> assertThat(resourceHint.getIncludes())
|
||||
.map(ResourcePatternHint::getPattern)
|
||||
.containsOnly(
|
||||
"org/springframework/context/testfixture/context/generator/annotation/ImportConfiguration.class"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user