()
| 121 | } |
| 122 | |
| 123 | async _getSpecifications() { |
| 124 | // Retrieve all configurations available for this module |
| 125 | let configs = await this._getConfigurations(); |
| 126 | |
| 127 | // Edge case: |
| 128 | // Search for project-shims to check whether this module defines a collection for itself |
| 129 | const isCollection = configs.find((configuration) => { |
| 130 | if (configuration.kind === "extension" && configuration.type === "project-shim") { |
| 131 | // TODO create Specification instance and ask it for the configuration |
| 132 | if (configuration.shims && configuration.shims.collections && |
| 133 | configuration.shims.collections[this.getId()]) { |
| 134 | return true; |
| 135 | } |
| 136 | } |
| 137 | }); |
| 138 | |
| 139 | if (isCollection) { |
| 140 | // This module is configured as a collection |
| 141 | // For compatibility reasons with the behavior of projectPreprocessor, |
| 142 | // the project contained in this module must be ignored |
| 143 | configs = configs.filter((configuration) => { |
| 144 | return configuration.kind !== "project"; |
| 145 | }); |
| 146 | } else { |
| 147 | // Patch configs |
| 148 | configs.forEach((configuration) => { |
| 149 | if (configuration.kind === "project" && configuration.type === "library" && |
| 150 | configuration.metadata && configuration.metadata.name) { |
| 151 | const libraryName = configuration.metadata.name; |
| 152 | // Old theme-libraries where configured as type "library" |
| 153 | if (SAP_THEMES_NS_EXEMPTIONS.includes(libraryName)) { |
| 154 | configuration.type = "theme-library"; |
| 155 | } |
| 156 | } |
| 157 | }); |
| 158 | } |
| 159 | |
| 160 | const specs = await Promise.all(configs.map(async (configuration) => { |
| 161 | const buildManifest = configuration._buildManifest; |
| 162 | if (configuration._buildManifest) { |
| 163 | delete configuration._buildManifest; |
| 164 | } |
| 165 | const spec = await Specification.create({ |
| 166 | id: this.getId(), |
| 167 | version: this.getVersion(), |
| 168 | modulePath: this.getPath(), |
| 169 | configuration, |
| 170 | buildManifest |
| 171 | }); |
| 172 | |
| 173 | log.verbose(`Module ${this.getId()} contains ${spec.getKind()} ${spec.getName()}`); |
| 174 | return spec; |
| 175 | })); |
| 176 | |
| 177 | const projects = specs.filter((spec) => { |
| 178 | return spec.getKind() === "project"; |
| 179 | }); |
| 180 |
no test coverage detected