ui5-tooling
ui5-tooling copied to clipboard
Add support for flat build output of the root (library-)project
Is your feature request related to a problem? Please describe.
Many target platforms for UI5 projects expect a "flat" directory structure to be deployed. Meaning that there is no resources/
directory and no my/company/project
namespace structure.
Explanation: Such projects might be deployed to different endpoints (i.e. they might not share a relative path). At UI5 runtime they are then loaded by configuring the corresponding resource mapping. This makes it unnecessary or even confusing in some cases to have another UI5 runtime-oriented directory structure below the project's deployment endpoint.
Describe the solution you'd like
This behavior is already in place for application projects. But it's missing for library and theme-library projects and the expected behavior for component projects is yet to be decided.
There are already multiple solutions available:
- SAP Web IDE executes a "flatten" script after every build which uses the
cp
andrm
UNIX commands - There's a custom task "ui5-task-flatten-library"
Since this is a very common use case and the basic functionality is already present in UI5 Tooling thanks to the ui5-fs abstraction layer, it might make sense to have this as a standard offering of UI5 Tooling itself.
Solution proposals
A solution might be to offer a CLI flag which always flattens the root project of the build.
An alternative would be to always flatten the root project if no other projects are being built (i.e. no --all
build).
Describe alternatives you've considered
See existing solutions above
Additional context
none