@ui5/project/specifications/Project
@ui5/project/specifications/Project
Project
Extends
Methods
getCustomConfiguration() → {object}
Description: Get the project's customConfiguration
Source: project/lib/specifications/Project.js, line 86
Returns:
Custom Configuration
Type: object
getFrameworkDependencies() → {Array<@ui5/project/specifications/Project~FrameworkDependency>}
Description: Get the project's framework dependencies configuration
Source: project/lib/specifications/Project.js, line 148
Returns:
Framework dependencies configuration
Type: Array<@ui5/project/specifications/Project~FrameworkDependency>
getFrameworkName() → {string}
Description: Get the project's framework name configuration
Source: project/lib/specifications/Project.js, line 116
Returns:
Framework name configuration, either OpenUI5 or SAPUI5
Type: string
getFrameworkVersion() → {string}
Description: Get the project's framework version configuration
Source: project/lib/specifications/Project.js, line 126
Returns:
Framework version configuration, e.g 1.110.0
Type: string
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/Specification#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/Specification#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/Specification#getName
Returns:
Specification name
Type: string
getNamespace() → {string|null}
Description: Get the project namespace. Returns null for projects that have none or multiple namespaces, for example Modules or Theme Libraries.
Source: project/lib/specifications/Project.js, line 63
Returns:
Project namespace in slash notation (e.g. my/project/name) or null
Type: string | null
getProjectResources() → {@ui5/project/resources/ProjectResources}
Description: Get the ProjectResources instance for this project.
Source: project/lib/specifications/Project.js, line 250
Returns:
The ProjectResources instance
Type: @ui5/project/resources/ProjectResources
getReader(optionsopt) → {@ui5/fs/ReaderCollection}
Description: Get a ReaderCollection for accessing all resources of the project in the specified "style":
- buildtime: Resource paths are always prefixed with
/resources/or/test-resources/followed by the project's namespace. Any configured build-excludes are applied - dist: Resource paths always match with what the UI5 runtime expects. This means that paths generally depend on the project type. Applications for example use a "flat"-like structure, while libraries use a "buildtime"-like structure. Any configured build-excludes are applied
- runtime: Resource paths always match with what the UI5 runtime expects. This means that paths generally depend on the project type. Applications for example use a "flat"-like structure, while libraries use a "buildtime"-like structure. This style is typically used for serving resources directly. Therefore, build-excludes are not applied
- flat: Resource paths are never prefixed and namespaces are omitted if possible. Note that project types like "theme-library", which can have multiple namespaces, can't omit them. Any configured build-excludes are applied
If project resources have been changed through the means of a workspace, those changes are reflected in the provided reader too.
Resource readers always use POSIX-style paths.
Source: project/lib/specifications/Project.js, line 286
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | optional | Properties:
|
Returns:
A reader collection instance
Type: @ui5/fs/ReaderCollection
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/Specification#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/Specification#getRootReader
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters | object | optional | Parameters Properties:
|
Returns:
Reader collection
Type: @ui5/fs/ReaderCollection
getSourcePath() → {string}
Description: Get the path of the project's source directory. This might not be POSIX-style on some platforms. Projects with multiple source paths will throw an error. For example Modules.
Source: project/lib/specifications/Project.js, line 98
Throws:
In case a project has multiple source directories
Type: Error
Returns:
Absolute path to the source directory of the project
Type: string
getSourceReader(styleopt) → {@ui5/fs/ReaderCollection}
Description: Get the source reader for the project.
Source: project/lib/specifications/Project.js, line 297
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
style | string | optional | buildtime | Path style to access resources |
Returns:
A reader collection instance
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/Specification#getSpecVersion
Returns:
Type: @ui5/project/specifications/SpecificationVersion
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/Specification#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/Specification#getVersion
Returns:
Project version
Type: string
getWorkspace() → {@ui5/fs/DuplexCollection}
Description: Get a DuplexCollection for accessing and modifying a project's resources. This is always of style buildtime.
Once a project has finished building, this method will throw to prevent further modifications since those would have no effect. Use the getReader method to access the project's (modified) resources
Source: project/lib/specifications/Project.js, line 311
Returns:
DuplexCollection
Type: @ui5/fs/DuplexCollection
isFrameworkProject() → {boolean}
Description: Check whether the project is a UI5-Framework project
Source: project/lib/specifications/Project.js, line 75
Returns:
True if the project is a framework project
Type: boolean
Type Definitions
FrameworkDependency
Description: Framework dependency entry of the project configuration. Also see Framework Configuration: Dependencies
Source: project/lib/specifications/Project.js, line 131
Properties:
| Name | Type | Description |
|---|---|---|
name | string | Name of the framework library. For example sap.ui.core |
development | boolean | Whether the dependency is meant for development purposes only |
optional | boolean | Whether the dependency should be treated as optional |
Framework dependency entry of the project configuration. Also see Framework Configuration: Dependencies
Type:
- object

