Skip to content

@ui5/project/specifications/extensions/Task ​

@ui5/project/specifications/extensions/Task ​

Task

Extends ​

Methods ​

(async) getDescriptor(taskName, options) → {Promise<object>}
​

Description: Resolves and validates the task descriptor by calling the task factory (the default export) once with the given options. The result is memoized per project and runtime taskName, so a factory that branches on options (for example on projectNamespace) is called once for each project/task pair. The build-signature phase and task execution share that descriptor. The runtime task name keeps repeated configurations (which get a --<number> suffix) separate.

Only valid from Specification Version 5.0. If the descriptor declares a specVersion, it must be equal to this task extension's configured Specification Version (the task extension's own ui5.yaml value, which is unrelated to the Specification Version of the project being built).

Source: project/lib/specifications/extensions/Task.js, line 52

Parameters: ​
NameTypeDescription
taskNamestringRuntime task name (memoization key)
optionsobjectOptions passed to the factory
Returns: ​

The validated descriptor

Type: Promise<object>

(async) getDetermineBuildSignatureCallback(taskNameopt, optionsopt)
​

Description: The task's determineBuildSignature callback. From Specification Version 5.0 it is a property of the descriptor the factory returns; below 5.0 the callback is not supported and this returns undefined.

Source: project/lib/specifications/extensions/Task.js, line 103

Parameters: ​
NameTypeAttributesDescription
taskNamestringoptionalRuntime task name (required at Specification Version 5.0)
optionsobjectoptionalOptions passed to the factory (required at Specification Version 5.0)

(async) getExpectedOutputCallback(taskNameopt, optionsopt)
​

Description: The task's determineExpectedOutput callback. From Specification Version 5.0 it is a property of the descriptor; below 5.0 it is a top-level named export. Currently parsed but not consumed anywhere.

Source: project/lib/specifications/extensions/Task.js, line 136

Parameters: ​
NameTypeAttributesDescription
taskNamestringoptionalRuntime task name (required at Specification Version 5.0)
optionsobjectoptionalOptions passed to the factory (required at Specification Version 5.0)

getId() → {string}
​

Description: Gets the ID of this specification.

Note: Only to be used for special occasions as it is specific to the provider that was used and does not necessarily represent something defined by the project.

For general purposes of a unique identifier use getName instead.

Source: project/lib/specifications/Specification.js, line 180

Overrides: @ui5/project/specifications/Extension#getId

Returns: ​

Specification ID

Type: string

getKind() → {string}
​

Description: Gets the kind of this specification, for example project or extension

Source: project/lib/specifications/Specification.js, line 200

Overrides: @ui5/project/specifications/Extension#getKind

Returns: ​

Specification kind

Type: string

getName() → {string}
​

Description: Gets the name of this specification. Represents a unique identifier.

Source: project/lib/specifications/Specification.js, line 190

Overrides: @ui5/project/specifications/Extension#getName

Returns: ​

Specification name

Type: string

(async) getRequiredDependenciesCallback(taskNameopt, optionsopt)
​

Description: The task's determineRequiredDependencies callback. From Specification Version 5.0 it is a property of the descriptor the factory returns; below 5.0 it is a top-level named export of the task module (legacy). Returns undefined if the task does not define it.

Source: project/lib/specifications/extensions/Task.js, line 87

Parameters: ​
NameTypeAttributesDescription
taskNamestringoptionalRuntime task name (required at Specification Version 5.0)
optionsobjectoptionalOptions passed to the factory (required at Specification Version 5.0)

getRootPath() → {string}
​

Description: Gets the specification's file system path. This might not be POSIX-style on some platforms

Source: project/lib/specifications/Specification.js, line 242

Overrides: @ui5/project/specifications/Extension#getRootPath

Returns: ​

Project root path

Type: string

getRootReader(parametersopt) → {@ui5/fs/ReaderCollection}
​

Description: Gets a ReaderCollection for the root directory of the specification. Resource readers always use POSIX-style

Source: project/lib/specifications/Specification.js, line 257

Overrides: @ui5/project/specifications/Extension#getRootReader

Parameters: ​
NameTypeAttributesDescription
parametersobjectoptionalParameters
Properties:
NameTypeAttributesDefaultDescription
useGitignoreobjectoptionaltrueWhether to apply any excludes defined in an optional .gitignore in the root directory
Returns: ​

Reader collection

Type: @ui5/fs/ReaderCollection

getSpecVersion() → {@ui5/project/specifications/SpecificationVersion}
​

Description: Returns an instance of a helper class representing a Specification Version

Source: project/lib/specifications/Specification.js, line 222

Overrides: @ui5/project/specifications/Extension#getSpecVersion

Returns: ​

Type: @ui5/project/specifications/SpecificationVersion

(async) getStepBased(taskNameopt, optionsopt) → {Promise<boolean>}
​

Description: Whether the task opts into the step-based build API, derived from the descriptor carrying a steps array (Specification Version 5.0 and later). Always false below 5.0, where the default export is the legacy task body.

Source: project/lib/specifications/extensions/Task.js, line 120

Parameters: ​
NameTypeAttributesDescription
taskNamestringoptionalRuntime task name (required at Specification Version 5.0)
optionsobjectoptionalOptions passed to the factory (required at Specification Version 5.0)
Returns: ​

true if the descriptor defines steps

Type: Promise<boolean>

(async) getTask()
​

Description: The task module's default export.

From Specification Version 5.0 this is the task factory (options) => descriptor; use #getDescriptor to obtain the validated descriptor. Below 5.0 it is the legacy task body that is invoked directly during the build (any value it returns is ignored).

Source: project/lib/specifications/extensions/Task.js, line 32

getType() → {string}
​

Description: Gets the type of this specification, for example application or library in case of projects, and task or server-middleware in case of extensions

Source: project/lib/specifications/Specification.js, line 212

Overrides: @ui5/project/specifications/Extension#getType

Returns: ​

Specification type

Type: string

getVersion() → {string}
​

Description: Gets the specification's generic version, as typically defined in a package.json

Source: project/lib/specifications/Specification.js, line 232

Overrides: @ui5/project/specifications/Extension#getVersion

Returns: ​

Project version

Type: string