Skip to content

Commit 7bae02b

Browse files
committed
Adapt to breaking changes to AotProcessor settings
See gh-32696
1 parent d53c2b2 commit 7bae02b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootTestAotProcessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public static void main(String[] args) {
5252
.formatted(TestAotProcessor.class.getName()));
5353
Set<Path> classpathRoots = Arrays.stream(args[0].split(File.pathSeparator)).map(Paths::get)
5454
.collect(Collectors.toSet());
55-
Settings settings = new Settings().setSourceOutput(Paths.get(args[1])).setResourceOutput(Paths.get(args[2]))
56-
.setClassOutput(Paths.get(args[3])).setGroupId(args[4]).setArtifactId(args[5]);
55+
Settings settings = Settings.builder().sourceOutput(Paths.get(args[1])).resourceOutput(Paths.get(args[2]))
56+
.classOutput(Paths.get(args[3])).groupId(args[4]).artifactId(args[5]).build();
5757
new SpringBootTestAotProcessor(classpathRoots, settings).process();
5858
}
5959

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplicationAotProcessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public static void main(String[] args) throws Exception {
6767
Assert.isTrue(args.length >= requiredArgs, () -> "Usage: " + SpringApplicationAotProcessor.class.getName()
6868
+ " <applicationName> <sourceOutput> <resourceOutput> <classOutput> <groupId> <artifactId> <originalArgs...>");
6969
Class<?> application = Class.forName(args[0]);
70-
Settings settings = new Settings().setSourceOutput(Paths.get(args[1])).setResourceOutput(Paths.get(args[2]))
71-
.setClassOutput(Paths.get(args[3])).setGroupId(args[4]).setArtifactId(args[5]);
70+
Settings settings = Settings.builder().sourceOutput(Paths.get(args[1])).resourceOutput(Paths.get(args[2]))
71+
.classOutput(Paths.get(args[3])).groupId(args[4]).artifactId(args[5]).build();
7272
String[] applicationArgs = (args.length > requiredArgs) ? Arrays.copyOfRange(args, requiredArgs, args.length)
7373
: new String[0];
7474
new SpringApplicationAotProcessor(application, settings, applicationArgs).process();

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationAotProcessorTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ void invokeMainWithMissingArguments() {
8080
}
8181

8282
private Settings settings(Path directory) {
83-
return new Settings().setSourceOutput(directory.resolve("source"))
84-
.setResourceOutput(directory.resolve("resource")).setClassOutput(directory.resolve("class"))
85-
.setGroupId("com.example").setArtifactId("example");
83+
return Settings.builder().sourceOutput(directory.resolve("source"))
84+
.resourceOutput(directory.resolve("resource")).classOutput(directory.resolve("class"))
85+
.groupId("com.example").artifactId("example").build();
8686

8787
}
8888

0 commit comments

Comments
 (0)