Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#490 7 comentarios 4 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
JavaScript
Estrellas
511
Forks
83
Merge medio
1 d 5 h
PR fusionados (30 d)
55

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de UI5/cli

Todos los issues de UI5/cli

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.