-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Provide hook for executing custom task after build has been completed #490
Comments
Related: #17 In the past I used to argue that I'm wondering, what's the motivation to integrate this into UI5 Tooling. Is there any API it can provide that would be beneficial? Your example seems to be pretty isolated and could also run in a separate script after Or is it more about the convenience of having all configurations in Please note that cleanup tasks are also executed in case the build has failed or has been aborted. From the documentation:
|
True, Regarding taskUtil.registerCleanupTask: yep that's why it is called a workaround The motivation is that e.g. there is an @sap/ux-ui5-tooling built on top of There should also be many other use cases for an |
I'm starting to think that the best approach to this would be to introduce a new extension type This allows the tooling to execute all necessary finalization steps, like removing resources based on tags and to rewrite paths as done for application projects. The I guess this is a good candidate for writing an RFC. I'll try and ask around for thoughts on this idea. |
@RandomByte I know this' an old issue, but it's still open and listed in the roadmap. In case this' still planned to be implemented, pls don't. Deployment shouldn't be coupled to build. Skipping build output creation is a terrible idea and goes against everything we see in other projects. Please, don't do that. If you must do something for deployment, make it its own new module, eg, |
Hey @mauriciolauffer, thanks for providing your input! From my understanding there is already a wide use for custom tasks implementing deployment functionality. Most prominently through the Fiori Tools These tasks currently face quite some problems as outlined above. Therefore, I see this as a rather small implementation topic that would greatly improve the situation for the already established use of deployment tasks. My proposal to eventually skip writing out the build result should of course be a configurable behavior. Since this feature would be optional for any project, may I ask what your main concern relates to? I would expect no impact on projects that decide to use a dedicated tool for deployment purposes. Which is still my personal recommendation as mentioned above. |
Separation of concerns. If you must create this task, call it something else rather than deploy, as it may be used for anything, not deployment only. |
@mauriciolauffer just as initially suggested "afterTask: buildCompleted". |
Is your feature request related to a problem? Please describe.
As of now (Specification Version 2.2) there is no proper way to execute a custom task after the build itself has succeeded.
It is only possible to execute a custom task after other individual build tasks (latest possible point of time is
afterTask: generateVersionInfo
)At this point of time the build itself has not been completed, so the
dist
folder has not been written yet.But a e.g. task for deployment requires the final
dist
folder for zipping and uploading.The @sap/ux-ui5-tooling custom task
deploy-to-abap
is an example for the lack of this feature.The custom task can only run
afterTask: generateVersionInfo
(documentation even statesafterTask: replaceVersion
, which is way to early btw).As a workaround the task only considers virtual build resources for deployment.
But only the
dist
folder contains the final physical resources and one should not rely on any virtual resources.Some custom tasks might even copy (physical) files from project shims to the
dist
folder during the build process (e.g. ui5-task-copy-shim-resources).Describe the solution you'd like
An example config could look like this to register a custom task after the build has completed:
or
Describe alternatives you've considered
A workaround for now is to use taskUtil.registerCleanupTask, because this is the only point of time where one can be sure that the build has completed.
Additional context
This should be a feature that many projects should require when it comes to delivering for production using the UI5 Tooling.
The text was updated successfully, but these errors were encountered: