diff --git a/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java index 7f53696ebe..cfdc1647b1 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/AsciidoctorConventions.java @@ -29,6 +29,7 @@ import org.asciidoctor.gradle.jvm.AsciidoctorTask; import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; import org.gradle.api.artifacts.ConfigurationContainer; +import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.Sync; import org.springframework.boot.build.artifactory.ArtifactoryRepository; @@ -139,7 +140,8 @@ class AsciidoctorConventions { syncDocumentationSource.setDestinationDir(syncedSource); syncDocumentationSource.from("src/docs/"); asciidoctorTask.dependsOn(syncDocumentationSource); - asciidoctorTask.getInputs().dir(syncedSource); + asciidoctorTask.getInputs().dir(syncedSource).withPathSensitivity(PathSensitivity.RELATIVE) + .withPropertyName("synced source"); asciidoctorTask.setSourceDir(project.relativePath(new File(syncedSource, "asciidoc/"))); return syncDocumentationSource; } diff --git a/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationMetadata.java b/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationMetadata.java index 724dbf6500..636a24396d 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationMetadata.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationMetadata.java @@ -31,6 +31,7 @@ import java.util.concurrent.Callable; import org.gradle.api.DefaultTask; import org.gradle.api.Task; import org.gradle.api.tasks.OutputFile; +import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.TaskAction; @@ -52,8 +53,10 @@ public class AutoConfigurationMetadata extends DefaultTask { private File outputFile; public AutoConfigurationMetadata() { - getInputs().file((Callable) () -> new File(this.sourceSet.getOutput().getResourcesDir(), - "META-INF/spring.factories")); + getInputs() + .file((Callable) () -> new File(this.sourceSet.getOutput().getResourcesDir(), + "META-INF/spring.factories")) + .withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("spring.factories"); dependsOn((Callable) () -> this.sourceSet.getProcessResourcesTaskName()); getProject().getConfigurations() .maybeCreate(AutoConfigurationPlugin.AUTO_CONFIGURATION_METADATA_CONFIGURATION_NAME); diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesPlugin.java index 9c0e52f5b7..7eefaa20b8 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/ConfigurationPropertiesPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import org.gradle.api.Task; import org.gradle.api.artifacts.Configuration; import org.gradle.api.plugins.JavaPlugin; import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.compile.JavaCompile; @@ -87,7 +88,8 @@ public class ConfigurationPropertiesPlugin implements Plugin { private void configureAdditionalMetadataLocationsCompilerArgument(Project project) { JavaCompile compileJava = project.getTasks().withType(JavaCompile.class) .getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME); - ((Task) compileJava).getInputs().files(project.getTasks().getByName(JavaPlugin.PROCESS_RESOURCES_TASK_NAME)); + ((Task) compileJava).getInputs().files(project.getTasks().getByName(JavaPlugin.PROCESS_RESOURCES_TASK_NAME)) + .withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("processed resources"); SourceSet mainSourceSet = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets() .getByName(SourceSet.MAIN_SOURCE_SET_NAME); compileJava.getOptions().getCompilerArgs() diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenExec.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenExec.java index dc4d3ad091..0536e69c0f 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenExec.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenExec.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,8 @@ public class MavenExec extends JavaExec { public void setProjectDir(File projectDir) { this.projectDir = projectDir; - getInputs().file(new File(projectDir, "pom.xml")).withPathSensitivity(PathSensitivity.RELATIVE); + getInputs().file(new File(projectDir, "pom.xml")).withPathSensitivity(PathSensitivity.RELATIVE) + .withPropertyName("pom"); } @Override diff --git a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java index 90d462c25d..ef0103432d 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/MavenPluginPlugin.java @@ -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"); * you may not use this file except in compliance with the License. @@ -50,6 +50,7 @@ import org.gradle.api.tasks.Classpath; import org.gradle.api.tasks.Copy; import org.gradle.api.tasks.JavaExec; import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.SourceSetContainer; import org.gradle.api.tasks.TaskAction; @@ -211,7 +212,8 @@ public class MavenPluginPlugin implements Plugin { MavenExec generatePluginDescriptor = project.getTasks().create("generatePluginDescriptor", MavenExec.class); generatePluginDescriptor.args("org.apache.maven.plugins:maven-plugin-plugin:3.6.0:descriptor"); generatePluginDescriptor.getOutputs().dir(new File(mavenDir, "target/classes/META-INF/maven")); - generatePluginDescriptor.getInputs().dir(new File(mavenDir, "target/classes/org")); + generatePluginDescriptor.getInputs().dir(new File(mavenDir, "target/classes/org")) + .withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("plugin classes"); generatePluginDescriptor.setProjectDir(mavenDir); return generatePluginDescriptor; } @@ -243,7 +245,8 @@ public class MavenPluginPlugin implements Plugin { void setGenerator(Task generator) { this.generator = generator; - getInputs().files(this.generator); + getInputs().files(this.generator).withPathSensitivity(PathSensitivity.RELATIVE) + .withPropertyName("generated source"); } @OutputDirectory diff --git a/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/TestSliceMetadata.java b/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/TestSliceMetadata.java index dea130b730..41a31f4821 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/TestSliceMetadata.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/test/autoconfigure/TestSliceMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,9 +64,9 @@ public class TestSliceMetadata extends DefaultTask { public TestSliceMetadata() { getInputs().dir((Callable) () -> this.sourceSet.getOutput().getResourcesDir()) - .withPathSensitivity(PathSensitivity.RELATIVE); + .withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("resources"); getInputs().files((Callable) () -> this.sourceSet.getOutput().getClassesDirs()) - .withPathSensitivity(PathSensitivity.RELATIVE); + .withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("classes"); } public void setSourceSet(SourceSet sourceSet) {