@ui5/project/build/ProjectBuilder
@ui5/project/build/ProjectBuilder
new @ui5/project/build/ProjectBuilder(parameters)
Description: Executes a project build, including all necessary or requested dependencies
Source: project/lib/build/ProjectBuilder.js, line 15
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Properties:
|
Methods
(async) build(parameters, projectBuiltCallbackopt) → {Promise<Array<string>>}
Description: Build projects without writing to a target directory.
Intended for long-running consumers (such as the BuildServer) that access build results through readers rather than the file system. Multiple sequential calls are supported and reuse the same build cache.
The caller is responsible for releasing the underlying build cache database by invoking #closeCacheManager once the builder is no longer needed. Failing to do so leaks the SQLite connection and its memory mapping, which on Windows also blocks deletion of the cache directory by subsequent processes.
Source: project/lib/build/ProjectBuilder.js, line 183
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Parameters Properties:
| ||||||||||||||||||||||||||
projectBuiltCallback | function | optional | Callback invoked after each project is built |
Returns:
Promise resolving with array of processed project names
Type: Promise<Array<string>>
(async) buildToTarget(parameters) → {Promise}
Description: Executes a project build, including all necessary or requested dependencies, and writes the result to the given target directory.
Closes the build cache database before returning, so #closeCacheManager does not need to be called by the consumer. After this method returns, the builder must not be used for further builds. For repeated builds against the same builder instance — e.g. in a long-running BuildServer — use #build instead and close the CacheManager explicitly when done.
Source: project/lib/build/ProjectBuilder.js, line 254
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Parameters Properties:
|
Returns:
Promise resolving once the build has finished
Type: Promise
closeCacheManager()
Description: Releases the build cache database connection and any underlying storage resources.
Must be called by consumers of #build once they are done with this builder (e.g. when shutting down a long-running BuildServer). #buildToTarget closes the CacheManager automatically and does not require this call.
Safe to call multiple times; subsequent calls are no-ops. After this method returns, the builder must not be used for further builds.
Source: project/lib/build/ProjectBuilder.js, line 157
resourcesChanged(changes) → {Set<string>}
Description: Propagate resource changes through the build context
Source: project/lib/build/ProjectBuilder.js, line 138
Parameters:
| Name | Type | Description |
|---|---|---|
changes | Array | Array of resource changes to propagate |
Throws:
If a build is currently running
Type: Error
Returns:
Names of projects potentially affected by the resource changes
Type: Set<string>
(async) validateCaches(parameters, projectValidatedCallbackopt) → {Promise<Array<string>>}
Description: Validate the build cache for a set of projects without actually building any of them.
Intended to be used by long-running consumers (such as the BuildServer) to proactively determine whether a cached build result can be reused for a project. Walks the dependency graph in the same order as #build, so dependencies are validated before their dependents and resource changes propagate correctly.
For each requested project, the given callback is invoked with the validation result once that project has been validated. The result indicates whether a cached build result is available and can be used (true) or whether a build would be required (false).
Like #build, this method is mutually exclusive with itself and with other build operations on the same builder instance. Source change propagation via #resourcesChanged is blocked while validation is running.
Source: project/lib/build/ProjectBuilder.js, line 225
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | Parameters Properties:
| |||||||||||||||||
projectValidatedCallback | function | optional | Callback invoked after each requested project has been validated. Receives (projectName, project, projectBuildContext, usesCache). |
Returns:
Promise resolving with the names of all processed projects
Type: Promise<Array<string>>
Type Definitions
BuildConfiguration
Description: Build Configuration
Source: project/lib/build/ProjectBuilder.js, line 19
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
selfContained | boolean | optional | false | Flag to activate self contained build |
cssVariables | boolean | optional | false | Flag to activate CSS variables generation |
jsdoc | boolean | optional | false | Flag to activate JSDoc build |
createBuildManifest | boolean | optional | false | Whether to create a build manifest file for the root project. This is currently only supported for projects of type 'library' and 'theme-library' No other dependencies can be included in the build result. |
outputStyle | module:@ui5/project/build/ProjectBuilderOutputStyle | optional | Default | Processes build results into a specific directory structure. |
includedTasks | Array<string> | optional | [] | List of tasks to be included |
excludedTasks | Array<string> | optional | [] | List of tasks to be excluded. If the wildcard '*' is provided, only the included tasks will be executed. |
cache | module:@ui5/project/build/cache/Cache | optional | Cache.Default | Cache mode to use for building UI5 projects |
Build Configuration
Type:
- object
DependencyIncludes
Description: As an alternative to providing plain lists of names of dependencies to include and exclude, you can provide a more complex "Dependency Includes" object to define which dependencies should be part of the build result.
This information is then used to compile lists of includedDependencies and excludedDependencies, which are applied during the build process.
Regular expression-parameters are directly applied to a list of all project dependencies so that they don't need to be evaluated in later processing steps.
Generally, includes are handled with a higher priority than excludes. Additionally, operations for processing transitive dependencies are handled with a lower priority than explicitly mentioned dependencies. The "default" dependency-includes are appended at the end.
The priority of the various dependency lists is applied in the following order. Note that a later exclude can't overrule an earlier include.
includeDependency,includeDependencyRegExpexcludeDependency,excludeDependencyRegExpincludeDependencyTreeexcludeDependencyTreedefaultIncludeDependency,defaultIncludeDependencyRegExp,defaultIncludeDependencyTree
Source: project/lib/build/ProjectBuilder.js, line 40
Properties:
| Name | Type | Description |
|---|---|---|
includeAllDependencies | boolean | Whether all dependencies should be part of the build result This parameter has the lowest priority and basically includes all remaining (not excluded) projects as include |
includeDependency | Array<string> | The dependencies to be considered in includedDependencies; the* character can be used as wildcard for all dependencies andis an alias for the CLI option --all |
includeDependencyRegExp | Array<string> | Strings which are interpreted as regular expressions to describe the selection of dependencies to be considered in includedDependencies |
includeDependencyTree | Array<string> | The dependencies to be considered in includedDependencies;transitive dependencies are also appended |
excludeDependency | Array<string> | The dependencies to be considered in excludedDependencies |
excludeDependencyRegExp | Array<string> | Strings which are interpreted as regular expressions to describe the selection of dependencies to be considered in excludedDependencies |
excludeDependencyTree | Array<string> | The dependencies to be considered in excludedDependencies;transitive dependencies are also appended |
defaultIncludeDependency | Array<string> | Same as includeDependency parameter;typically used in project build settings |
defaultIncludeDependencyRegExp | Array<string> | Same as includeDependencyRegExp parameter;typically used in project build settings |
defaultIncludeDependencyTree | Array<string> | Same as includeDependencyTree parameter;typically used in project build settings |
As an alternative to providing plain lists of names of dependencies to include and exclude, you can provide a more complex "Dependency Includes" object to define which dependencies should be part of the build result.
This information is then used to compile lists of includedDependencies and excludedDependencies, which are applied during the build process.
Regular expression-parameters are directly applied to a list of all project dependencies so that they don't need to be evaluated in later processing steps.
Generally, includes are handled with a higher priority than excludes. Additionally, operations for processing transitive dependencies are handled with a lower priority than explicitly mentioned dependencies. The "default" dependency-includes are appended at the end.
The priority of the various dependency lists is applied in the following order. Note that a later exclude can't overrule an earlier include.
includeDependency,includeDependencyRegExpexcludeDependency,excludeDependencyRegExpincludeDependencyTreeexcludeDependencyTreedefaultIncludeDependency,defaultIncludeDependencyRegExp,defaultIncludeDependencyTree
Type:
- object

