Use Sync task rather than Copy

See gh-42333
This commit is contained in:
Phillip Webb 2024-10-01 17:19:52 -07:00
parent e5b03a7741
commit d342eefa27
2 changed files with 6 additions and 6 deletions

View File

@ -25,9 +25,9 @@ dependencies {
implementation("org.springframework:spring-core") implementation("org.springframework:spring-core")
} }
task copyIntegrationTestSources(type: Copy) { task syncIntegrationTestSources(type: Sync) {
destinationDir file("${buildDir}/it")
from file("src/it") from file("src/it")
into "${buildDir}/it"
filter(springRepoistoryTransformers.ant()) filter(springRepoistoryTransformers.ant())
} }
@ -39,7 +39,7 @@ processResources {
} }
task integrationTest { task integrationTest {
dependsOn copyIntegrationTestSources, jar dependsOn syncIntegrationTestSources, jar
def resultsDir = file("${buildDir}/test-results/integrationTest") def resultsDir = file("${buildDir}/test-results/integrationTest")
inputs.dir(file("src/it")).withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("source") inputs.dir(file("src/it")).withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("source")
inputs.files(sourceSets.main.runtimeClasspath).withNormalizer(ClasspathNormalizer).withPropertyName("classpath") inputs.files(sourceSets.main.runtimeClasspath).withNormalizer(ClasspathNormalizer).withPropertyName("classpath")

View File

@ -46,16 +46,16 @@ task syncTestRepository(type: Sync) {
} }
} }
task copyAntSources(type: Copy) { task syncAntSources(type: Sync) {
destinationDir file("${buildDir}/ant")
from project.layout.projectDirectory from project.layout.projectDirectory
include "*.xml" include "*.xml"
into "${buildDir}/ant"
filter(springRepoistoryTransformers.ant()) filter(springRepoistoryTransformers.ant())
} }
task antRun(type: JavaExec) { task antRun(type: JavaExec) {
workingDir "${buildDir}/ant" workingDir "${buildDir}/ant"
dependsOn syncTestRepository, copyAntSources, configurations.antDependencies dependsOn syncTestRepository, syncAntSources, configurations.antDependencies
classpath = configurations.antDependencies; classpath = configurations.antDependencies;
mainClass = "org.apache.tools.ant.launch.Launcher" mainClass = "org.apache.tools.ant.launch.Launcher"
args = [ "clean", "build" ] args = [ "clean", "build" ]