Skip to content

Commit

Permalink
Drop webhook models before copying them
Browse files Browse the repository at this point in the history
  • Loading branch information
Beppe Catanese committed Nov 12, 2024
1 parent 685a4be commit 5ffa342
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions go/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5ffa342

Please sign in to comment.