Skip to content

Commit

Permalink
Merge pull request #34 from Adyen/go-drop-webhook-models-before-copy
Browse files Browse the repository at this point in the history
Go generation: regenerate webhook models
  • Loading branch information
DjoykeAbyah authored Nov 12, 2024
2 parents 685a4be + 5ffa342 commit 41cb64a
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 41cb64a

Please sign in to comment.