Skip to content

remove cds-dk installation from build script of db#184

Merged
beckermarc merged 2 commits intomainfrom
mta_cleanup
Dec 20, 2022
Merged

remove cds-dk installation from build script of db#184
beckermarc merged 2 commits intomainfrom
mta_cleanup

Conversation

@mofterdinger
Copy link
Copy Markdown
Member

@mofterdinger mofterdinger commented Dec 9, 2022

This PR removes the @sap/cds-dk installation from the build script in db/package.json. Now, the build script relies on a previous local installation of the cds-dk, e.g. done with a maven build. Or a globally installed cds-dk version is used.
The mbt build works fine, because first the srv module is built, then the db module.

@beckermarc
Copy link
Copy Markdown
Contributor

The mbt build works fine, because first the srv module is built, then the db module.

Is this order modelled somewhere explicitly?

@mofterdinger
Copy link
Copy Markdown
Member Author

mofterdinger commented Dec 9, 2022

The mbt build works fine, because first the srv module is built, then the db module.

Is this order modelled somewhere explicitly?

I'm not sure, but it looks like it's the order of the modules in the mta.yaml: srv, db, app. At least it's my experience with this project and mbt.

@mofterdinger
Copy link
Copy Markdown
Member Author

mofterdinger commented Dec 9, 2022

Verified it, it's the order of the modules in the mta.yaml. If I change the order to db, srv, app, first the db module is built. Since the node_modules folder is not existing, the globally installed cds-dk is used:

[cds] - building project [/Users/d032842/SAPDevelop/git/cloud-cap-samples-java], clean [true]
[cds] - cds [6.3.2], compiler [3.4.4], home [/usr/local/lib/node_modules/@sap/cds-dk/node_modules/@sap/cds]

With the build order srv, db, app the cds-dk is used from the local installation:

[cds] - building project [/Users/d032842/SAPDevelop/git/cloud-cap-samples-java], clean [true]
[cds] - cds [6.3.2], compiler [3.4.4], home [/Users/d032842/SAPDevelop/git/cloud-cap-samples-java/node_modules/@sap/cds-dk/node_modules/@sap/cds]

@beckermarc
Copy link
Copy Markdown
Contributor

Can this be modelled somehow explicitly? Not sure, if this is considered an implementation detail by mbt build or if this is documented behaviour. We need to be careful to rely on that if this behaviour is not considered as "API"

@mofterdinger
Copy link
Copy Markdown
Member Author

Can this be modelled somehow explicitly? Not sure, if this is considered an implementation detail by mbt build or if this is documented behaviour. We need to be careful to rely on that if this behaviour is not considered as "API"

Yes, it's possible to maintain a build order of the modules. Further details can be found here: https://sap.github.io/cloud-mta-build-tool/configuration/#defining-module-build-order

Copy link
Copy Markdown
Contributor

@beckermarc beckermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this, not sure what @BraunMatthias thinks, as we now deviate again from the defaults :D

@beckermarc beckermarc merged commit c9d6b2a into main Dec 20, 2022
@beckermarc beckermarc deleted the mta_cleanup branch December 20, 2022 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants