Adapt to breaking changes to AotProcessor settings
See gh-32696
This commit is contained in:
@@ -52,8 +52,8 @@ public class SpringBootTestAotProcessor extends TestAotProcessor {
|
||||
.formatted(TestAotProcessor.class.getName()));
|
||||
Set<Path> classpathRoots = Arrays.stream(args[0].split(File.pathSeparator)).map(Paths::get)
|
||||
.collect(Collectors.toSet());
|
||||
Settings settings = new Settings().setSourceOutput(Paths.get(args[1])).setResourceOutput(Paths.get(args[2]))
|
||||
.setClassOutput(Paths.get(args[3])).setGroupId(args[4]).setArtifactId(args[5]);
|
||||
Settings settings = Settings.builder().sourceOutput(Paths.get(args[1])).resourceOutput(Paths.get(args[2]))
|
||||
.classOutput(Paths.get(args[3])).groupId(args[4]).artifactId(args[5]).build();
|
||||
new SpringBootTestAotProcessor(classpathRoots, settings).process();
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@ public class SpringApplicationAotProcessor extends ContextAotProcessor {
|
||||
Assert.isTrue(args.length >= requiredArgs, () -> "Usage: " + SpringApplicationAotProcessor.class.getName()
|
||||
+ " <applicationName> <sourceOutput> <resourceOutput> <classOutput> <groupId> <artifactId> <originalArgs...>");
|
||||
Class<?> application = Class.forName(args[0]);
|
||||
Settings settings = new Settings().setSourceOutput(Paths.get(args[1])).setResourceOutput(Paths.get(args[2]))
|
||||
.setClassOutput(Paths.get(args[3])).setGroupId(args[4]).setArtifactId(args[5]);
|
||||
Settings settings = Settings.builder().sourceOutput(Paths.get(args[1])).resourceOutput(Paths.get(args[2]))
|
||||
.classOutput(Paths.get(args[3])).groupId(args[4]).artifactId(args[5]).build();
|
||||
String[] applicationArgs = (args.length > requiredArgs) ? Arrays.copyOfRange(args, requiredArgs, args.length)
|
||||
: new String[0];
|
||||
new SpringApplicationAotProcessor(application, settings, applicationArgs).process();
|
||||
|
||||
@@ -80,9 +80,9 @@ class SpringApplicationAotProcessorTests {
|
||||
}
|
||||
|
||||
private Settings settings(Path directory) {
|
||||
return new Settings().setSourceOutput(directory.resolve("source"))
|
||||
.setResourceOutput(directory.resolve("resource")).setClassOutput(directory.resolve("class"))
|
||||
.setGroupId("com.example").setArtifactId("example");
|
||||
return Settings.builder().sourceOutput(directory.resolve("source"))
|
||||
.resourceOutput(directory.resolve("resource")).classOutput(directory.resolve("class"))
|
||||
.groupId("com.example").artifactId("example").build();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user