pfefferf / ui5-nwabap-deployer

UI5 Deployer for SAP NetWeaver ABAP
Apache License 2.0
55 stars 18 forks source link

Support UI5 Tooling 3.0 #60

Closed shaiSAP closed 1 year ago

shaiSAP commented 1 year ago

As described in https://github.com/SAP/ui5-tooling/issues/781#issuecomment-1431254954, for compatibility with UI5 Tooling 3.0, the custom task need to be adjusted:

implement the recommended callback to signal this to UI5 Tooling as outlined here. Alternatively, the task could also switch to specifying specVersion: 3.0

Without these adjustments, the UI5 Tooling v3 would build all the projects dependencies even if the custom task doesn't require access to them (What may take a lot of time).

RandomByte commented 1 year ago

@shaiSAP beat me to it 😉

I was just about to raise an issue too. So here you go:

Besides many other changes, the recently released UI5 Tooling Version 3 automatically builds all required dependencies for a project.

For compatibility reasons, custom tasks defining Specification Versions before 3.0 are assumed to require access to all available dependencies. This can lead to situations where for an application project, which otherwise would not require any dependencies to be build, UI5 Tooling will still build them, because of a custom task.

While we are working on reducing the impact of this behavior on the total build time, ideally by introducing caching mechanisms to UI5 Tooling in the future, I would ask you to enhance your custom task ui5-task-nwabap-deployer to signal that it does not require access to any dependencies.

From what I could see, the dependencies parameter is never used in the task. This indicates that access to dependencies is not required.

There are two options available:

  1. To stay compatible with UI5 Tooling v2 releases, you can export a new function determineRequiredDependencies which returns an empty set (return new Set())
  2. Alternatively, you can upgrade your task to Specification Version 3.0 (specVersion: 3.0 in the task's ui5.yaml). By default, custom tasks defining Specification Versions later than 3.0 are not provided with any dependencies and need to explicitly request them using the mentioned callback. However, this would be a breaking change since UI5 Tooling v2 won't be able to use the task anymore

Please also refer to our documentation: Custom Tasks: Required Dependencies

pfefferf commented 1 year ago

@shaiSAP @RandomByte Thank you for bringing that up. Solved with ui5-task-nwabap-deployer@2.1.1