Generate the AutoConfiguration.imports file from annotations

This commit adds the `AutoConfigurationImportsAnnotationProcessor` to
the `spring-boot-autoconfigure-processor` annotation processor
module. When added to a project build, the annotation processor will
generate the
`org.springframework.boot.autoconfigure.AutoConfiguration.imports`
file automatically from `@AutoConfiguration`-annotated classes. It
also applies the annotation processor to the Spring Boot build.

Closes gh-31228
This commit is contained in:
Scott Frederick
2022-09-02 13:24:26 -05:00
parent 795ea289db
commit da4de7d67d
16 changed files with 265 additions and 338 deletions

View File

@@ -21,6 +21,7 @@ dependencies {
testRepository(project(path: ":spring-boot-project:spring-boot-dependencies", configuration: "mavenRepository"))
testRepository(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin", configuration: "mavenRepository"))
testRepository(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-autoconfigure-processor", configuration: "mavenRepository"))
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter", configuration: "mavenRepository"))
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-jetty", configuration: "mavenRepository"))
testRepository(project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-json", configuration: "mavenRepository"))

View File

@@ -49,6 +49,8 @@ tasks.register("resourcesJar", Jar) { jar ->
}
dependencies {
annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor")
compileOnly("org.eclipse.jetty:jetty-server")
implementation("org.springframework.boot:spring-boot-starter")