Samples for build-tasks

This commit is contained in:
Daniel
2021-02-26 09:19:26 +01:00
parent d368eb2ff5
commit 2552269cec
3 changed files with 70 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
const cds = require ('./sap-cds')
module.exports = class extends cds.build.Task {
async build ({src='*'}) {
this.log (`Generating edmx output for '${src}'...`)
const csn = await this.model(src)
return Promise.all (csn.services.map (srv => {
const edmx = cds.compile(csn).to.edmx({service:srv.name})
return this.write(edmx).to(`{srv}/src/main/resources/${srv.name}.edmx`)
}))
}
}