From bc3fe7861ebaae8a3ba1fd824c49ca286609c6d0 Mon Sep 17 00:00:00 2001 From: Lothar Bender Date: Fri, 3 Nov 2023 14:47:57 +0100 Subject: [PATCH] fix build plugin registration and Java output folder --- postgres/cds-plugin.js | 4 ++-- postgres/lib/build.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/postgres/cds-plugin.js b/postgres/cds-plugin.js index bfb58377f..daf634d06 100644 --- a/postgres/cds-plugin.js +++ b/postgres/cds-plugin.js @@ -5,6 +5,6 @@ if (!cds.env.fiori.lean_draft) { } cds.build?.register?.('postgres', { - impl: __dirname + '/lib/build.js', - taskDefaults: { src: cds.env.folders.db, dest: 'pg' } + impl: '@cap-js/postgres/lib/build.js', + taskDefaults: { src: cds.env.folders.db } }) diff --git a/postgres/lib/build.js b/postgres/lib/build.js index 8bd9cfeb6..145511983 100644 --- a/postgres/lib/build.js +++ b/postgres/lib/build.js @@ -15,8 +15,8 @@ module.exports = class PostgresBuildPlugin extends cds.build.BuildPlugin { promises.push(this.write({ dependencies: { '@sap/cds': '^7', '@cap-js/postgres': '^1' }, scripts: { start: 'cds-deploy' }, - }).to('package.json')) - promises.push(this.write(cds.compile.to.json(model)).to(path.join('db', 'csn.json'))) + }).to('pg/package.json')) + promises.push(this.write(cds.compile.to.json(model)).to(path.join('pg/db', 'csn.json'))) let data if (fs.existsSync(path.join(this.task.src, 'data'))) { @@ -25,7 +25,7 @@ module.exports = class PostgresBuildPlugin extends cds.build.BuildPlugin { data = 'csv' } if (data) { - promises.push(this.copy(data).to(path.join('db', 'data'))) + promises.push(this.copy(data).to(path.join('pg/db', 'data'))) } return Promise.all(promises) }