From 5ffa34292bec2a16761e4e7a204bf5f094d27125 Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Tue, 12 Nov 2024 12:44:00 +0100 Subject: [PATCH] Drop webhook models before copying them --- go/build.gradle | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/go/build.gradle b/go/build.gradle index 298573b..640afea 100644 --- a/go/build.gradle +++ b/go/build.gradle @@ -84,11 +84,15 @@ tasks.named('generateLegalEntityManagement', GenerateTask) { packageName.set('legalentity') } -// Rename webhooks +// Generate and rename webhooks services.findAll { it.name.endsWith('Webhooks') }.each { Service svc -> - def singular = svc.id.dropRight(1) + def singular = svc.id.dropRight(1) // drop s (e.g. from AcsWebhooks to AcsWebhook) tasks.named("generate${svc.name}", GenerateTask) { packageName.set(singular) } - tasks.named("deploy${svc.name}", Copy) { into layout.projectDirectory.dir("repo/src/${singular}") } + tasks.named("deploy${svc.name}", Copy) { + def targetDir = layout.projectDirectory.dir("repo/src/${singular}") + delete targetDir // Drop content first + into targetDir // Copy models + } } tasks.named('deployLegalEntityManagement', Copy) {