Feature Request: Provide hook for executing custom task after build has been completed
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- build-system, cli, tooling
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- JavaScript
- スター
- 511
- フォーク
- 83
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 55
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
UI5/cli のほかの issue
-
Chromium 153+: UTF-8 BOM kept by `@ui5/builder` in bundles breaks apps対応中かも @flovogt が 7 日前に担当しました。 オープンmodule/ui5-builder
UI5/cli#1601 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Build cache: buildThemes cache is invalidated by irrelevant library.js / .library content changesオープンmodule/ui5-builder module/ui5-fs module/ui5-project
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
module/ui5-project
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
[ROADMAP] UI5 CLI 6.0 / Specification Version 6.0再び着手できるかも @flovogt が 49 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンroadmap
UI5/cli#1485 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
build excludes from application project are not applied to dependencies対応中かも @flovogt が 23 日前に担当しました。 オープン
UI5/cli#1446 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
status: waiting triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
freeCodeCamp/freeCodeCamp#70412 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Jason-Vaughan/TangleClaw#1884 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue web
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoft/TypeScript#64453 ·
メンテナーはふだん 1 日以内に返信
-
self-driving
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信