mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Ensure that classes and resources are in place before documenting
Closes gh-25948
This commit is contained in:
parent
d7b43a3c68
commit
709db5582b
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019-2020 the original author or authors.
|
* Copyright 2019-2021 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -66,8 +66,10 @@ public class AutoConfigurationPlugin implements Plugin<Project> {
|
|||||||
.add(project.getDependencies().project(Collections.singletonMap("path",
|
.add(project.getDependencies().project(Collections.singletonMap("path",
|
||||||
":spring-boot-project:spring-boot-tools:spring-boot-configuration-processor")));
|
":spring-boot-project:spring-boot-tools:spring-boot-configuration-processor")));
|
||||||
project.getTasks().create("autoConfigurationMetadata", AutoConfigurationMetadata.class, (task) -> {
|
project.getTasks().create("autoConfigurationMetadata", AutoConfigurationMetadata.class, (task) -> {
|
||||||
task.setSourceSet(project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets()
|
SourceSet main = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets()
|
||||||
.getByName(SourceSet.MAIN_SOURCE_SET_NAME));
|
.getByName(SourceSet.MAIN_SOURCE_SET_NAME);
|
||||||
|
task.setSourceSet(main);
|
||||||
|
task.dependsOn(main.getClassesTaskName());
|
||||||
task.setOutputFile(new File(project.getBuildDir(), "auto-configuration-metadata.properties"));
|
task.setOutputFile(new File(project.getBuildDir(), "auto-configuration-metadata.properties"));
|
||||||
project.getArtifacts().add(AutoConfigurationPlugin.AUTO_CONFIGURATION_METADATA_CONFIGURATION_NAME,
|
project.getArtifacts().add(AutoConfigurationPlugin.AUTO_CONFIGURATION_METADATA_CONFIGURATION_NAME,
|
||||||
project.provider((Callable<File>) task::getOutputFile), (artifact) -> artifact.builtBy(task));
|
project.provider((Callable<File>) task::getOutputFile), (artifact) -> artifact.builtBy(task));
|
||||||
|
Loading…
Reference in New Issue
Block a user