Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Feature Request: Provide hook for executing custom task after build has been completed

Đang mở
#490 7 bình luận 4 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
build-system, cli, tooling

Hướng nghiên cứu

Start with the custom task lifecycle configuration described in the issue and the TaskUtil.registerCleanupTask API used by the workaround. Trace how cleanup tasks are scheduled relative to writing the dist folder. Done means a documented lifecycle hook can run after the build completes and access the final physical dist resources.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 states afterTask: 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:

builder:
  customTasks:
  - name: deploy-to-abap
    afterTask: buildCompleted
    configuration:
      some: configurations 

or

tooling:
  lifecycleTasks:
  - name: deploy-to-abap
    after: buildCompleted
    configuration:
      some: configurations 

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.

module.exports = async ({ taskUtil, options }) => {
  const { configuration = {} } = options
  const { target, credentials, app } = configuration
  const { url, client } = target
  const { username, password } = credentials
  const { transport } = app
  // https://sap.github.io/ui5-tooling/api/module-@ui5_builder.tasks.TaskUtil.html
  taskUtil.registerCleanupTask(async () => {
    await abapDeploy({
      sourceFolder: path.join(process.cwd(), 'dist'),
      targetSystem: url,
      client,
      username,
      password,
      abapTransport: transport
    })
    await cleanup([
      '.ABAPDeployResources',
      'abap-deploy.log',
      'dist.zip'
    ])
  })
}

Additional context

This should be a feature that many projects should require when it comes to delivering for production using the UI5 Tooling.

Ngôn ngữ chính
JavaScript
Star
511
Fork
83
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
55

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của UI5/cli

Tất cả issue của UI5/cli

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.