()
| 164 | } |
| 165 | |
| 166 | async run(): Promise<BuildSuccessEvent> { |
| 167 | let startTime = Date.now(); |
| 168 | if (!this.#initialized) { |
| 169 | await this._init(); |
| 170 | } |
| 171 | |
| 172 | let result = await this._build({startTime}); |
| 173 | |
| 174 | await this._end(); |
| 175 | |
| 176 | if (result.type === 'buildFailure') { |
| 177 | throw new BuildError(result.diagnostics); |
| 178 | } |
| 179 | |
| 180 | return result; |
| 181 | } |
| 182 | |
| 183 | async _end(): Promise<void> { |
| 184 | this.#initialized = false; |