"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesPlugin.java" between
spring-boot-2.7.3.tar.gz and spring-boot-2.7.4.tar.gz

About: Spring Boot helps to create Spring-powered, production-grade applications and services.

ConfigurationPropertiesPlugin.java  (spring-boot-2.7.3):ConfigurationPropertiesPlugin.java  (spring-boot-2.7.4)
skipping to change at line 19 skipping to change at line 19
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.build.context.properties; package org.springframework.boot.build.context.properties;
import java.io.File;
import java.util.Collections; import java.util.Collections;
import java.util.concurrent.Callable;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.gradle.api.Plugin; import org.gradle.api.Plugin;
import org.gradle.api.Project; import org.gradle.api.Project;
import org.gradle.api.Task; import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.Configuration;
import org.gradle.api.file.RegularFile; import org.gradle.api.file.RegularFile;
import org.gradle.api.plugins.JavaPlugin; import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention; import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.provider.Provider; import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.TaskProvider; import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.compile.JavaCompile; import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.language.base.plugins.LifecycleBasePlugin; import org.gradle.language.base.plugins.LifecycleBasePlugin;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/** /**
skipping to change at line 97 skipping to change at line 95
} }
private void addConfigurationProcessorDependency(Project project) { private void addConfigurationProcessorDependency(Project project) {
Configuration annotationProcessors = project.getConfigurations() Configuration annotationProcessors = project.getConfigurations()
.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIG URATION_NAME); .getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIG URATION_NAME);
annotationProcessors.getDependencies().add(project.getDependencie s().project(Collections.singletonMap("path", annotationProcessors.getDependencies().add(project.getDependencie s().project(Collections.singletonMap("path",
":spring-boot-project:spring-boot-tools:spring-bo ot-configuration-processor"))); ":spring-boot-project:spring-boot-tools:spring-bo ot-configuration-processor")));
} }
private void disableIncrementalCompilation(Project project) { private void disableIncrementalCompilation(Project project) {
SourceSet mainSourceSet = project.getConvention().getPlugin(JavaP luginConvention.class).getSourceSets() SourceSet mainSourceSet = project.getExtensions().getByType(JavaP luginExtension.class).getSourceSets()
.getByName(SourceSet.MAIN_SOURCE_SET_NAME); .getByName(SourceSet.MAIN_SOURCE_SET_NAME);
project.getTasks().named(mainSourceSet.getCompileJavaTaskName(), JavaCompile.class) project.getTasks().named(mainSourceSet.getCompileJavaTaskName(), JavaCompile.class)
.configure((compileJava) -> compileJava.getOption s().setIncremental(false)); .configure((compileJava) -> compileJava.getOption s().setIncremental(false));
} }
private void addMetadataArtifact(Project project) { private void addMetadataArtifact(Project project) {
SourceSet mainSourceSet = project.getConvention().getPlugin(JavaP luginConvention.class).getSourceSets() SourceSet mainSourceSet = project.getExtensions().getByType(JavaP luginExtension.class).getSourceSets()
.getByName(SourceSet.MAIN_SOURCE_SET_NAME); .getByName(SourceSet.MAIN_SOURCE_SET_NAME);
project.getConfigurations().maybeCreate(CONFIGURATION_PROPERTIES_ METADATA_CONFIGURATION_NAME); project.getConfigurations().maybeCreate(CONFIGURATION_PROPERTIES_ METADATA_CONFIGURATION_NAME);
project.afterEvaluate((evaluatedProject) -> evaluatedProject.getA rtifacts().add( project.afterEvaluate((evaluatedProject) -> evaluatedProject.getA rtifacts().add(
CONFIGURATION_PROPERTIES_METADATA_CONFIGURATION_N AME, CONFIGURATION_PROPERTIES_METADATA_CONFIGURATION_N AME,
evaluatedProject.provider((Callable<File>) () -> mainSourceSet.getJava().getDestinationDirectory()
new File(mainSourceSet.getJava().getOutputDir(), .dir("META-INF/spring-configuration-metadata.json"),
"META-INF/spring-configuration-me
tadata.json")),
(artifact) -> artifact (artifact) -> artifact
.builtBy(evaluatedProject.getTask s().getByName(mainSourceSet.getClassesTaskName())))); .builtBy(evaluatedProject.getTask s().getByName(mainSourceSet.getClassesTaskName()))));
} }
private void configureAdditionalMetadataLocationsCompilerArgument(Project project) { private void configureAdditionalMetadataLocationsCompilerArgument(Project project) {
JavaCompile compileJava = project.getTasks().withType(JavaCompile .class) JavaCompile compileJava = project.getTasks().withType(JavaCompile .class)
.getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME); .getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME);
((Task) compileJava).getInputs().files(project.getTasks().getByNa me(JavaPlugin.PROCESS_RESOURCES_TASK_NAME)) ((Task) compileJava).getInputs().files(project.getTasks().getByNa me(JavaPlugin.PROCESS_RESOURCES_TASK_NAME))
.withPathSensitivity(PathSensitivity.RELATIVE).wi thPropertyName("processed resources"); .withPathSensitivity(PathSensitivity.RELATIVE).wi thPropertyName("processed resources");
SourceSet mainSourceSet = project.getConvention().getPlugin(JavaP luginConvention.class).getSourceSets() SourceSet mainSourceSet = project.getExtensions().getByType(JavaP luginExtension.class).getSourceSets()
.getByName(SourceSet.MAIN_SOURCE_SET_NAME); .getByName(SourceSet.MAIN_SOURCE_SET_NAME);
compileJava.getOptions().getCompilerArgs() compileJava.getOptions().getCompilerArgs()
.add("-Aorg.springframework.boot.configurationpro cessor.additionalMetadataLocations=" + StringUtils .add("-Aorg.springframework.boot.configurationpro cessor.additionalMetadataLocations=" + StringUtils
.collectionToCommaDelimitedString (mainSourceSet.getResources().getSourceDirectories().getFiles() .collectionToCommaDelimitedString (mainSourceSet.getResources().getSourceDirectories().getFiles()
.stream().map(pro ject.getRootProject()::relativePath).collect(Collectors.toSet()))); .stream().map(pro ject.getRootProject()::relativePath).collect(Collectors.toSet())));
} }
private void registerCheckAdditionalMetadataTask(Project project) { private void registerCheckAdditionalMetadataTask(Project project) {
TaskProvider<CheckAdditionalSpringConfigurationMetadata> checkCon figurationMetadata = project.getTasks() TaskProvider<CheckAdditionalSpringConfigurationMetadata> checkCon figurationMetadata = project.getTasks()
.register(CHECK_ADDITIONAL_SPRING_CONFIGURATION_M ETADATA_TASK_NAME, .register(CHECK_ADDITIONAL_SPRING_CONFIGURATION_M ETADATA_TASK_NAME,
CheckAdditionalSpringConfiguratio nMetadata.class); CheckAdditionalSpringConfiguratio nMetadata.class);
checkConfigurationMetadata.configure((check) -> { checkConfigurationMetadata.configure((check) -> {
SourceSet mainSourceSet = project.getConvention().getPlug in(JavaPluginConvention.class).getSourceSets() SourceSet mainSourceSet = project.getExtensions().getByTy pe(JavaPluginExtension.class).getSourceSets()
.getByName(SourceSet.MAIN_SOURCE_SET_NAME ); .getByName(SourceSet.MAIN_SOURCE_SET_NAME );
check.setSource(mainSourceSet.getResources()); check.setSource(mainSourceSet.getResources());
check.include("META-INF/additional-spring-configuration-m etadata.json"); check.include("META-INF/additional-spring-configuration-m etadata.json");
check.getReportLocation().set(project.getLayout().getBuil dDirectory() check.getReportLocation().set(project.getLayout().getBuil dDirectory()
.file("reports/additional-spring-configur ation-metadata/check.txt")); .file("reports/additional-spring-configur ation-metadata/check.txt"));
}); });
project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME) project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME)
.configure((check) -> check.dependsOn(checkConfig urationMetadata)); .configure((check) -> check.dependsOn(checkConfig urationMetadata));
} }
private void registerCheckMetadataTask(Project project) { private void registerCheckMetadataTask(Project project) {
TaskProvider<CheckSpringConfigurationMetadata> checkConfiguration Metadata = project.getTasks() TaskProvider<CheckSpringConfigurationMetadata> checkConfiguration Metadata = project.getTasks()
.register(CHECK_SPRING_CONFIGURATION_METADATA_TAS K_NAME, CheckSpringConfigurationMetadata.class); .register(CHECK_SPRING_CONFIGURATION_METADATA_TAS K_NAME, CheckSpringConfigurationMetadata.class);
checkConfigurationMetadata.configure((check) -> { checkConfigurationMetadata.configure((check) -> {
SourceSet mainSourceSet = project.getConvention().getPlug in(JavaPluginConvention.class).getSourceSets() SourceSet mainSourceSet = project.getExtensions().getByTy pe(JavaPluginExtension.class).getSourceSets()
.getByName(SourceSet.MAIN_SOURCE_SET_NAME ); .getByName(SourceSet.MAIN_SOURCE_SET_NAME );
Provider<RegularFile> metadataLocation = project.getTasks () Provider<RegularFile> metadataLocation = project.getTasks ()
.named(mainSourceSet.getCompileJavaTaskNa me(), JavaCompile.class) .named(mainSourceSet.getCompileJavaTaskNa me(), JavaCompile.class)
.flatMap((javaCompile) -> javaCompile.get DestinationDirectory() .flatMap((javaCompile) -> javaCompile.get DestinationDirectory()
.file("META-INF/spring-co nfiguration-metadata.json")); .file("META-INF/spring-co nfiguration-metadata.json"));
check.getMetadataLocation().set(metadataLocation); check.getMetadataLocation().set(metadataLocation);
check.getReportLocation().set( check.getReportLocation().set(
project.getLayout().getBuildDirectory().f ile("reports/spring-configuration-metadata/check.txt")); project.getLayout().getBuildDirectory().f ile("reports/spring-configuration-metadata/check.txt"));
}); });
project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME) project.getTasks().named(LifecycleBasePlugin.CHECK_TASK_NAME)
 End of changes. 9 change blocks. 
12 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)