File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class ProjectPreprocessor {
11
11
this . processedProjects = { } ;
12
12
this . configShims = { } ;
13
13
this . collections = { } ;
14
+ this . appliedExtensions = { } ;
14
15
}
15
16
16
17
/*
@@ -304,11 +305,25 @@ class ProjectPreprocessor {
304
305
}
305
306
306
307
async applyExtension ( extension ) {
307
- log . verbose ( `Applying extension ${ extension . id } ...` ) ;
308
-
309
308
if ( ! extension . metadata || ! extension . metadata . name ) {
310
309
throw new Error ( `metadata.name configuration is missing for extension ${ extension . id } ` ) ;
311
- } // TODO: more checks? Version?
310
+ }
311
+ log . verbose ( `Applying extension ${ extension . metadata . name } ...` ) ;
312
+
313
+ if ( ! extension . specVersion ) {
314
+ throw new Error ( `No specification version defined for extension ${ extension . metadata . name } ` ) ;
315
+ } else if ( extension . specVersion !== "0.1" ) {
316
+ throw new Error (
317
+ `Invalid specification version defined for extension ${ extension . metadata . name } : ` +
318
+ `${ extension . specVersion } . The currently only allowed version is "0.1"` ) ;
319
+ } else if ( this . appliedExtensions [ extension . metadata . name ] ) {
320
+ log . verbose ( `Extension with the name ${ extension . metadata . name } has already been applied. ` +
321
+ "This might have been done during dependency lookahead." ) ;
322
+ log . verbose ( `Already applied extension ID: ${ this . appliedExtensions [ extension . metadata . name ] . id } . ` +
323
+ `New extension ID: ${ extension . id } ` ) ;
324
+ return ;
325
+ }
326
+ this . appliedExtensions [ extension . metadata . name ] = extension ;
312
327
313
328
switch ( extension . type ) {
314
329
case "project-shim" :
You can’t perform that action at this time.
0 commit comments