Skip to content

Commit

Permalink
Adding more services
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpaul committed Sep 25, 2023
1 parent e34a525 commit f6f7b4f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 9 deletions.
18 changes: 15 additions & 3 deletions buildSrc/src/main/groovy/adyen.sdk-automation-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,25 @@ ext {
generator = project.name
templates = 'templates'
services = [
// Payments
new Service(name: 'Checkout', version: 70),
new Service(name: 'LegalEntity', version: 3),
new Service(name: 'Payout', version: 68),
new Service(name: 'Recurring', version: 68),
new Service(name: 'BinLookup', version: 54),
// Point of Sale
new Service(name: 'POSTerminalManagement', spec: 'TfmAPI', version: 1),
// Management
new Service(name: 'Management', version: 1),
new Service(name: 'Transfers', spec: 'Transfer', version: 3),
new Service(name: 'BalanceControl', version: 1),
// Adyen for Platforms
new Service(name: 'LegalEntityManagement', spec: 'LegalEntity', version: 3),
new Service(name: 'BalancePlatform', version: 2),
new Service(name: 'POSTerminalManagement', spec: 'TfmAPI', version: 1),
new Service(name: 'Transfers', spec: 'Transfer', version: 3),
new Service(name: 'DataProtection', version: 1),
// Classic Payments
new Service(name: 'Payment', version: 68),
// Others
new Service(name: 'StoredValue', version: 46),
]
serviceName = ''
}
Expand Down
38 changes: 35 additions & 3 deletions go/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ project.ext {
}

// Service renaming
tasks.named('generatePOSTerminalManagement', GenerateTask) {
tasks.named('generatePOSTerminalManagement') {
project.ext.serviceName = 'PosTerminalManagementApi'
}
tasks.named('generateLegalEntityManagement') {
project.ext.serviceName = 'LegalEntity'
}

tasks.withType(GenerateTask).configureEach {
packageName.set(it.name)
enablePostProcessFile.set(true)
globalProperties.set([
'apis' : '',
Expand All @@ -33,15 +35,45 @@ tasks.withType(GenerateTask).configureEach {

// Deployment
project.ext.services.each { Service svc ->
def generateTask = "generate$svc.name"
def deploy = tasks.register("deploy$svc.name", Copy) {
description "Copy $svc.name files into the repo."
dependsOn "generate$svc.name"
dependsOn generateTask
outputs.upToDateWhen { false }

from layout.buildDirectory.dir("services/$svc.id")
include "**/*.go"
into layout.projectDirectory.dir("repo/src/$svc.id")
}

tasks.named(svc.id) { dependsOn deploy }

tasks.named(generateTask, GenerateTask) {
packageName.set(svc.id)
}
}

tasks.named('generatePayment', GenerateTask) {
packageName.set('payments')
}

tasks.named('generateLegalEntityManagement', GenerateTask) {
packageName.set('legalentity')
}

tasks.named('deployLegalEntityManagement', Copy) {
into layout.projectDirectory.dir("repo/src/legalentity")
}

tasks.named('deployPayment', Copy) {
into layout.projectDirectory.dir("repo/src/payments")
}

// Small services don't need a "index"
['BalanceControl', 'BinLookup', 'Recurring', 'DataProtection', 'StoredValue', 'POSTerminalManagement'].each {
tasks.named("deploy$it", Copy) {
exclude 'client.go'
}
}

// Services with a RestServiceError model
Expand Down
4 changes: 1 addition & 3 deletions php/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ plugins {
id 'adyen.sdk-automation-conventions'
}

// Service renaming
tasks.named 'legalentity', { project.ext.serviceName = 'LegalEntityManagement' }

tasks.withType(GenerateTask).configureEach {
modelPackage.set("Model\\${project.ext.serviceName}")
apiPackage.set("Service\\${project.ext.serviceName}")
Expand All @@ -22,6 +19,7 @@ project.ext.services.each { Service svc ->
def deploy = tasks.register("deploy$svc.name", Copy) {
description "Copy $svc.name files into the repo."
dependsOn "generate$svc.name"
outputs.upToDateWhen { false }

into layout.projectDirectory.dir("repo/src/Adyen")
def source = "services/$svc.id/lib"
Expand Down

0 comments on commit f6f7b4f

Please sign in to comment.