From 5a76975699f244594ad01ce9a0a8531897dc5e78 Mon Sep 17 00:00:00 2001 From: kunlongli Date: Wed, 25 May 2022 21:21:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DcopyToRelease=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=89=A7=E8=A1=8C=E9=A1=BA=E5=BA=8F=E9=94=99=E8=AF=AF?= =?UTF-8?q?=20#143?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/com/tencent/devops/actions/CopyToReleaseAction.kt | 1 + .../com/tencent/devops/conventions/SpringBootConvention.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/devops-boot-project/devops-boot-tools/devops-boot-gradle-plugin/src/main/kotlin/com/tencent/devops/actions/CopyToReleaseAction.kt b/devops-boot-project/devops-boot-tools/devops-boot-gradle-plugin/src/main/kotlin/com/tencent/devops/actions/CopyToReleaseAction.kt index 466975a..79059cf 100644 --- a/devops-boot-project/devops-boot-tools/devops-boot-gradle-plugin/src/main/kotlin/com/tencent/devops/actions/CopyToReleaseAction.kt +++ b/devops-boot-project/devops-boot-tools/devops-boot-gradle-plugin/src/main/kotlin/com/tencent/devops/actions/CopyToReleaseAction.kt @@ -12,6 +12,7 @@ class CopyToReleaseAction : Action { override fun execute(copy: Copy) { with(copy) { + copy.dependsOn(project.tasks.named("bootJar")) val withVersion = project.findPropertyOrEmpty(COPY_WITH_VERSION).toBoolean() val bootJar = project.tasks.withType(BootJar::class.java).first() from(bootJar.archiveFile) diff --git a/devops-boot-project/devops-boot-tools/devops-boot-gradle-plugin/src/main/kotlin/com/tencent/devops/conventions/SpringBootConvention.kt b/devops-boot-project/devops-boot-tools/devops-boot-gradle-plugin/src/main/kotlin/com/tencent/devops/conventions/SpringBootConvention.kt index f562693..8139437 100644 --- a/devops-boot-project/devops-boot-tools/devops-boot-gradle-plugin/src/main/kotlin/com/tencent/devops/conventions/SpringBootConvention.kt +++ b/devops-boot-project/devops-boot-tools/devops-boot-gradle-plugin/src/main/kotlin/com/tencent/devops/conventions/SpringBootConvention.kt @@ -28,7 +28,7 @@ class SpringBootConvention { private fun configureCopyToRelease(project: Project) { with(project.tasks) { val copyToRelease = register(CopyToReleaseAction.TASK_NAME, Copy::class.java, CopyToReleaseAction()) - getByName("build").dependsOn(copyToRelease) + named("build").configure { it.dependsOn(copyToRelease) } } } }