tasks

@ui5/builder. tasks

Classes

TaskUtil

Methods

(static) buildThemes(parameters) → {Promise.<undefined>}

Source:
Task to build a library theme.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
options object Options
Properties
Name Type Attributes Default Description
projectName string Project name
inputPattern string Search pattern for *.less files to be built
librariesPattern string <optional>
Search pattern for .library files
themesPattern string <optional>
Search pattern for sap.ui.core theme folders
compress boolean <optional>
true
cssVariables boolean <optional>
false
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) createDebugFiles(parameters) → {Promise.<undefined>}

Source:
Task to create dbg files.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
options object Options
Properties
Name Type Description
pattern string Pattern to locate the files to be processed
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) escapeNonAsciiCharacters(parameters) → {Promise.<undefined>}

Source:
Task to escape non ascii characters in properties files resources.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
options object Options
Properties
Name Type Description
pattern string Glob pattern to locate the files to be processed
encoding string source file encoding either "UTF-8" or "ISO-8859-1"
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(async, static) executeJsdocSdkTransformation(parameters) → {Promise.<undefined>}

Source:
Task to transform the api.json file as created by the generateJsdoc task into a pre-processed api.json file suitable for the SDK.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
options object Options
Properties
Name Type Description
dotLibraryPattern string | Array Pattern to locate the .library resource to be processed
projectName string Project name
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateApiIndex(parameters) → {Promise.<undefined>}

Source:
Compiles an api-index.json resource from all available api.json resources as created by the executeJsdocSdkTransformation task. The resulting api-index.json resource is mainly to be used in the SDK.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
options object Options
Properties
Name Type Description
projectName string Project name
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateBundle(parameters) → {Promise}

Source:
Generates a bundle based on the given bundle definition
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Attributes Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.ReaderCollection Collection to read dependency files
taskUtil module:@ui5/builder.tasks.TaskUtil | object <optional>
TaskUtil
options object Options
Properties
Name Type Description
projectName string Project name
bundleDefinition ModuleBundleDefinition Module bundle definition
bundleOptions ModuleBundleOptions Module bundle options
Returns:
Promise resolving with undefined once data has been written
Type
Promise

(static) generateCachebusterInfo(parameters) → {Promise.<undefined>}

Source:
Task to generate the application cachebuster info file.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
options object Options
Properties
Name Type Attributes Default Description
namespace string Namespace of the application
signatureType string <optional>
'time' Type of signature to be used ('time' or 'hash')
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateComponentPreload(parameters) → {Promise.<undefined>}

Source:
Task to for application bundling.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Attributes Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
taskUtil module:@ui5/builder.tasks.TaskUtil | object <optional>
TaskUtil
options object Options
Properties
Name Type Attributes Default Description
projectName string Project name
excludes Array.<string> <optional>
[] List of modules declared as glob patterns (resource name patterns) that should be excluded. A pattern ending with a slash '/' will, similarly to the use of a single '*' or double '**' asterisk, denote an arbitrary number of characters or folder names. Re-includes should be marked with a leading exclamation mark '!'. The order of filters is relevant; a later inclusion overrides an earlier exclusion, and vice versa.
paths Array.<string> <optional>
Array of paths (or glob patterns) for component files
namespaces Array.<string> <optional>
Array of component namespaces
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateFlexChangesBundle(parameters) → {Promise.<undefined>}

Source:
Task to create changesBundle.json file containing all changes stored in the /changes folder for easier consumption at runtime. If a change bundle is created, "sap.ui.fl" is added as a dependency to the manifest.json if not already present - if the dependency is already listed but lazy-loaded, lazy loading is disabled. If minUI5Version >= 1.73 flexibility-bundle.json will be create. If there are control variants and minUI5Version < 1.73 build will break and throw an error.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Attributes Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
taskUtil module:@ui5/builder.tasks.TaskUtil | object <optional>
TaskUtil
options object <optional>
Options
Properties
Name Type Attributes Description
namespace string <optional>
Application Namespace
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(async, static) generateJsdoc(parameters) → {Promise.<undefined>}

Source:
Task to execute a JSDoc build for UI5 projects
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Attributes Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
options GenerateJsdocOptions Options
taskUtil module:@ui5/builder.tasks.TaskUtil | object <optional>
TaskUtil
buildContext object <optional>
Internal, deprecated parameter
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateLibraryManifest(parameters) → {Promise.<undefined>}

Source:
Task for creating a library manifest.json from its .library file.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
options object Options
Properties
Name Type Description
projectName string Project name
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateLibraryPreload(parameters) → {Promise.<undefined>}

Source:
Task for library bundling.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Attributes Default Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
taskUtil module:@ui5/builder.tasks.TaskUtil | object <optional>
TaskUtil
options.excludes Array.<string> <optional>
[] List of modules declared as glob patterns (resource name patterns) that should be excluded from the library-preload.js bundle. A pattern ending with a slash '/' will, similarly to the use of a single '*' or double '**' asterisk, denote an arbitrary number of characters or folder names. Re-includes should be marked with a leading exclamation mark '!'. The order of filters is relevant; a later inclusion overrides an earlier exclusion, and vice versa.
options object Options
Properties
Name Type Description
projectName string Project name
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateManifestBundle(parameters) → {Promise.<undefined>}

Source:
Task for manifestBundler.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
options ManifestBundlerOptions Options
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateResourcesJson(parameters) → {Promise.<undefined>}

Source:
Task for creating a resources.json file, describing all productive build resources.

The detailed structure can be found in the documentation: https://sdk.openui5.org/topic/adcbcf8b50924556ab3f321fcd9353ea

Not supported in combination with task module:@ui5/builder.tasks.generateStandaloneAppBundle. Therefore it is also not supported in combination with self-contained build.

Example

sample resources.json

const resourcesJson = {
	"_version": "1.1.0",
	"resources": [
		{
			"name": "Component-preload.js",
			"module": "application/mine/Component-preload.js",
			"size": 3746,
			"merged": true,
			"included": [
				"application/mine/Component.js",
				"application/mine/changes/coding/MyExtension.js",
				"application/mine/changes/flexibility-bundle.json",
				"application/mine/changes/fragments/MyFragment.fragment.xml",
				"application/mine/manifest.json"
			]
		},
		{
			"name": "resources.json",
			"size": 1870
		},
		{
			"name": "rules/Button-dbg.support.js",
			"module": "application/mine/rules/Button.support.js",
			"size": 211,
			"format": "raw",
			"isDebug": true,
			"required": [
				"application/mine/library.js",
				"sap/ui/core/Control.js"
			],
			"condRequired": [
				"application/mine/changeHandler/SplitButton.js",
				"sap/ui/core/format/DateFormat.js"
			],
			"dynRequired": true,
			"support": true
		}
	]
};
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Attributes Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader <optional>
Reader or Collection to read dependency files
options object Options
Properties
Name Type Description
projectName string Project name
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateStandaloneAppBundle(parameters) → {Promise.<undefined>}

Source:
Task for bundling standalone applications.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Attributes Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
taskUtil module:@ui5/builder.tasks.TaskUtil | object <optional>
TaskUtil
options object Options
Properties
Name Type Attributes Description
projectName string Project name
namespace string <optional>
Project namespace
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateThemeDesignerResources(parameters) → {Promise.<undefined>}

Source:
Generates resources required for integration with the SAP Theme Designer.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
options object Options
Properties
Name Type Attributes Description
projectName string Project name
version string Project version
namespace string <optional>
If the project is of type library, provide its namespace. Omit for type theme-library
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) generateVersionInfo(parameters) → {Promise.<undefined>}

Source:
Task to create sap-ui-version.json
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
dependencies module:@ui5/fs.AbstractReader Reader or Collection to read dependency files
options object Options
Properties
Name Type Description
pattern string Glob pattern for .library resources
rootProject object DuplexCollection to read and write files
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) replaceBuildtime(parameters) → {Promise.<undefined>}

Source:
Task to replace the buildtime ${buildtime}.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
options object Options
Properties
Name Type Description
pattern string Pattern to locate the files to be processed
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) replaceCopyright(parameters) → {Promise.<undefined>}

Source:
Task to to replace the copyright. The following placeholders are replaced with corresponding values:
  • ${copyright}
  • @copyright@
If the copyright string contains the optional placeholder ${currentYear} it will be replaced with the current year. If no copyright string is given, no replacement is being done.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
options object Options
Properties
Name Type Description
copyright string Replacement copyright
pattern string Pattern to locate the files to be processed
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) replaceVersion(parameters) → {Promise.<undefined>}

Source:
Task to replace the version ${version}.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
options object Options
Properties
Name Type Description
pattern string Pattern to locate the files to be processed
version string Replacement version
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>

(static) uglify(parameters) → {Promise.<undefined>}

Source:
Task to minify resources.
Parameters:
Name Type Description
parameters object Parameters
Properties
Name Type Attributes Description
workspace module:@ui5/fs.DuplexCollection DuplexCollection to read and write files
taskUtil module:@ui5/builder.tasks.TaskUtil | object <optional>
TaskUtil
options object Options
Properties
Name Type Description
pattern string Pattern to locate the files to be processed
Returns:
Promise resolving with undefined once data has been written
Type
Promise.<undefined>