Fix up-to-date checking of syncAppSource tasks

Previously, the project version was used while filtering the apps
source during syncing but it was not considered as an input to
the task. This could result in the syncing being skipped even though
the project's version had changed.

This commit introduces a new custom task to make the configuration
more declarative and to allow the necessary input configuration to be
done in a single place.

Closes gh-28197
This commit is contained in:
Andy Wilkinson
2021-10-05 11:08:22 +01:00
parent 1fc52b65a3
commit 8c3820f87e
4 changed files with 84 additions and 18 deletions

View File

@@ -40,12 +40,9 @@ task syncTestRepository(type: Sync) {
}
}
task syncAppSource(type: Sync) {
from "spring-boot-server-tests-app"
into "${buildDir}/spring-boot-server-tests-app"
filter { line ->
line.replace("id \"org.springframework.boot\"", "id \"org.springframework.boot\" version \"${project.version}\"")
}
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-server-tests-app")
destinationDirectory = file("${buildDir}/spring-boot-server-tests-app")
}
task buildApps(type: GradleBuild) {