Replace deprecated Project.task()

See gh-45009

Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
Johnny Lim
2025-04-05 23:46:08 +09:00
committed by Phillip Webb
parent ce64f368e6
commit 08c67cc353
41 changed files with 92 additions and 92 deletions

View File

@@ -23,24 +23,24 @@ dependencies {
dockerTestImplementation("org.testcontainers:testcontainers")
}
task syncMavenRepository(type: Sync) {
tasks.register("syncMavenRepository", Sync) {
from configurations.app
into layout.buildDirectory.dir("docker-test-maven-repository")
}
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
tasks.register("syncAppSource", org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-launch-script-tests-app")
destinationDirectory = file(layout.buildDirectory.dir("spring-boot-launch-script-tests-app"))
}
task buildApp(type: GradleBuild) {
tasks.register("buildApp", GradleBuild) {
dependsOn syncAppSource, syncMavenRepository
dir = layout.buildDirectory.dir("spring-boot-launch-script-tests-app")
startParameter.buildCacheEnabled = false
tasks = ["build"]
}
task downloadJdk(type: Download) {
tasks.register("downloadJdk", Download) {
def destFolder = new File(project.gradle.gradleUserHomeDir, "caches/springboot/downloads/jdk/bellsoft")
destFolder.mkdirs()
src "https://download.bell-sw.com/java/${jdkVersion}/bellsoft-jdk${jdkVersion}-linux-${jdkArch}.tar.gz"
@@ -50,7 +50,7 @@ task downloadJdk(type: Download) {
retries 3
}
task syncJdkDownloads(type: Sync) {
tasks.register("syncJdkDownloads", Sync) {
dependsOn downloadJdk
from "${project.gradle.gradleUserHomeDir}/caches/springboot/downloads/jdk/bellsoft/"
include "bellsoft-jdk${jdkVersion}-linux-${jdkArch}.tar.gz"

View File

@@ -20,17 +20,17 @@ dependencies {
dockerTestImplementation("org.testcontainers:testcontainers")
}
task syncMavenRepository(type: Sync) {
tasks.register("syncMavenRepository", Sync) {
from configurations.app
into layout.buildDirectory.dir("docker-test-maven-repository")
}
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
tasks.register("syncAppSource", org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-loader-classic-tests-app")
destinationDirectory = file(layout.buildDirectory.dir("spring-boot-loader-classic-tests-app"))
}
task buildApp(type: GradleBuild) {
tasks.register("buildApp", GradleBuild) {
dependsOn syncAppSource, syncMavenRepository
dir = layout.buildDirectory.dir("spring-boot-loader-classic-tests-app")
startParameter.buildCacheEnabled = false

View File

@@ -26,36 +26,36 @@ dependencies {
dockerTestImplementation("org.testcontainers:testcontainers")
}
task syncMavenRepository(type: Sync) {
tasks.register("syncMavenRepository", Sync) {
from configurations.app
into layout.buildDirectory.dir("docker-test-maven-repository")
}
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
tasks.register("syncAppSource", org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-loader-tests-app")
destinationDirectory = file(layout.buildDirectory.dir("spring-boot-loader-tests-app"))
}
task buildApp(type: GradleBuild) {
tasks.register("buildApp", GradleBuild) {
dependsOn syncAppSource, syncMavenRepository
dir = layout.buildDirectory.dir("spring-boot-loader-tests-app")
startParameter.buildCacheEnabled = false
tasks = ["build"]
}
task syncSignedJarAppSource(type: org.springframework.boot.build.SyncAppSource) {
tasks.register("syncSignedJarAppSource", org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-loader-tests-signed-jar")
destinationDirectory = file(layout.buildDirectory.dir("spring-boot-loader-tests-signed-jar"))
}
task buildSignedJarApp(type: GradleBuild) {
tasks.register("buildSignedJarApp", GradleBuild) {
dependsOn syncSignedJarAppSource, syncMavenRepository
dir = layout.buildDirectory.dir("spring-boot-loader-tests-signed-jar")
startParameter.buildCacheEnabled = false
tasks = ["build"]
}
task downloadJdk(type: Download) {
tasks.register("downloadJdk", Download) {
def destFolder = new File(project.gradle.gradleUserHomeDir, "caches/springboot/downloads/jdk/oracle")
destFolder.mkdirs()
src "https://download.oracle.com/java/17/archive/jdk-${oracleJdkVersion}_linux-${oracleJdkArch}_bin.tar.gz"
@@ -65,7 +65,7 @@ task downloadJdk(type: Download) {
retries 3
}
task syncJdkDownloads(type: Sync) {
tasks.register("syncJdkDownloads", Sync) {
dependsOn downloadJdk
from "${project.gradle.gradleUserHomeDir}/caches/springboot/downloads/jdk/oracle/"
include "jdk-${oracleJdkVersion}_linux-${oracleJdkArch}_bin.tar.gz"

View File

@@ -28,19 +28,19 @@ dependencies {
testRuntimeOnly(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-logging"))
}
task syncTestRepository(type: Sync) {
tasks.register("syncTestRepository", Sync) {
destinationDir = file(layout.buildDirectory.dir("test-repository"))
from {
configurations.testRepository
}
}
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
tasks.register("syncAppSource", org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-server-tests-app")
destinationDirectory = file(layout.buildDirectory.dir("spring-boot-server-tests-app"))
}
task buildApps(type: GradleBuild) {
tasks.register("buildApps", GradleBuild) {
dependsOn syncAppSource, syncTestRepository
dir = layout.buildDirectory.dir("spring-boot-server-tests-app")
startParameter.buildCacheEnabled = false

View File

@@ -27,17 +27,17 @@ dependencies {
intTestImplementation("org.testcontainers:testcontainers")
}
task syncMavenRepository(type: Sync) {
tasks.register("syncMavenRepository", Sync) {
from configurations.app
into layout.buildDirectory.dir("int-test-maven-repository")
}
task syncReactiveServerAppSource(type: org.springframework.boot.build.SyncAppSource) {
tasks.register("syncReactiveServerAppSource", org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-sni-reactive-app")
destinationDirectory = file(layout.buildDirectory.dir("spring-boot-sni-reactive-app"))
}
task buildReactiveServerApps(type: GradleBuild) {
tasks.register("buildReactiveServerApps", GradleBuild) {
dependsOn syncReactiveServerAppSource, syncMavenRepository
dir = layout.buildDirectory.dir("spring-boot-sni-reactive-app")
startParameter.buildCacheEnabled = false
@@ -48,12 +48,12 @@ task buildReactiveServerApps(type: GradleBuild) {
]
}
task syncServletServerAppSource(type: org.springframework.boot.build.SyncAppSource) {
tasks.register("syncServletServerAppSource", org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-sni-servlet-app")
destinationDirectory = file(layout.buildDirectory.dir("spring-boot-sni-servlet-app"))
}
task buildServletServerApps(type: GradleBuild) {
tasks.register("buildServletServerApps", GradleBuild) {
dependsOn syncServletServerAppSource, syncMavenRepository
dir = layout.buildDirectory.dir("spring-boot-sni-servlet-app")
startParameter.buildCacheEnabled = false
@@ -63,12 +63,12 @@ task buildServletServerApps(type: GradleBuild) {
]
}
task syncClientAppSource(type: org.springframework.boot.build.SyncAppSource) {
tasks.register("syncClientAppSource", org.springframework.boot.build.SyncAppSource) {
sourceDirectory = file("spring-boot-sni-client-app")
destinationDirectory = file(layout.buildDirectory.dir("spring-boot-sni-client-app"))
}
task buildClientApp(type: GradleBuild) {
tasks.register("buildClientApp", GradleBuild) {
dependsOn syncClientAppSource, syncMavenRepository
dir = layout.buildDirectory.dir("spring-boot-sni-client-app")
startParameter.buildCacheEnabled = false