|
|
|
|
@ -25,14 +25,11 @@ import java.util.ArrayList;
@@ -25,14 +25,11 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.function.Consumer; |
|
|
|
|
|
|
|
|
|
import org.springframework.aot.generate.ClassNameGenerator; |
|
|
|
|
import org.springframework.aot.generate.DefaultGenerationContext; |
|
|
|
|
import org.springframework.aot.generate.FileSystemGeneratedFiles; |
|
|
|
|
import org.springframework.aot.generate.GeneratedFiles.Kind; |
|
|
|
|
import org.springframework.aot.hint.ExecutableHint; |
|
|
|
|
import org.springframework.aot.hint.ExecutableMode; |
|
|
|
|
import org.springframework.aot.hint.ReflectionHints; |
|
|
|
|
import org.springframework.aot.hint.RuntimeHints; |
|
|
|
|
import org.springframework.aot.hint.TypeReference; |
|
|
|
|
@ -58,9 +55,6 @@ import org.springframework.util.FileSystemUtils;
@@ -58,9 +55,6 @@ import org.springframework.util.FileSystemUtils;
|
|
|
|
|
*/ |
|
|
|
|
public class AotProcessor { |
|
|
|
|
|
|
|
|
|
private static final Consumer<ExecutableHint.Builder> INVOKE_CONSTRUCTOR_HINT = (hint) -> hint |
|
|
|
|
.setModes(ExecutableMode.INVOKE); |
|
|
|
|
|
|
|
|
|
private final Class<?> application; |
|
|
|
|
|
|
|
|
|
private final String[] applicationArgs; |
|
|
|
|
@ -161,8 +155,8 @@ public class AotProcessor {
@@ -161,8 +155,8 @@ public class AotProcessor {
|
|
|
|
|
ReflectionHints reflection = generationContext.getRuntimeHints().reflection(); |
|
|
|
|
reflection.registerType(applicationType, (hint) -> { |
|
|
|
|
}); |
|
|
|
|
reflection.registerType(generatedType, (hint) -> hint.onReachableType(applicationType) |
|
|
|
|
.withConstructor(Collections.emptyList(), INVOKE_CONSTRUCTOR_HINT)); |
|
|
|
|
reflection.registerType(generatedType, |
|
|
|
|
(hint) -> hint.onReachableType(applicationType).withConstructor(Collections.emptyList())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Path getRoot(Kind kind) { |
|
|
|
|
|