Adapt to changes in DefaultGenerationContext

See https://github.com/spring-projects/spring-framework/issues/28877
This commit is contained in:
Stephane Nicoll
2022-07-26 18:06:35 +02:00
parent d6cce1f441
commit 193c1d7acf
3 changed files with 6 additions and 10 deletions

View File

@@ -101,7 +101,7 @@ public class AotProcessor {
/**
* Trigger the processing of the application managed by this instance.
*/
public void process() {
public void process() throws IOException {
deleteExistingOutput();
AotProcessorHook hook = new AotProcessorHook();
SpringApplicationHooks.withHook(hook, this::callApplicationMainMethod);
@@ -142,7 +142,7 @@ public class AotProcessor {
}
}
private void performAotProcessing(GenericApplicationContext applicationContext) {
private void performAotProcessing(GenericApplicationContext applicationContext) throws IOException {
FileSystemGeneratedFiles generatedFiles = new FileSystemGeneratedFiles(this::getRoot);
DefaultGenerationContext generationContext = new DefaultGenerationContext(
new ClassNameGenerator(this.application), generatedFiles);

View File

@@ -45,7 +45,7 @@ class AotProcessorTests {
}
@Test
void processApplicationInvokesRunMethod(@TempDir Path directory) {
void processApplicationInvokesRunMethod(@TempDir Path directory) throws IOException {
String[] arguments = new String[] { "1", "2" };
AotProcessor processor = new AotProcessor(SampleApplication.class, arguments, directory.resolve("source"),
directory.resolve("resource"), directory.resolve("class"), "com.example", "example");