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 {
1111 this . processedProjects = { } ;
1212 this . configShims = { } ;
1313 this . collections = { } ;
14+ this . appliedExtensions = { } ;
1415 }
1516
1617 /*
@@ -304,11 +305,25 @@ class ProjectPreprocessor {
304305 }
305306
306307 async applyExtension ( extension ) {
307- log . verbose ( `Applying extension ${ extension . id } ...` ) ;
308-
309308 if ( ! extension . metadata || ! extension . metadata . name ) {
310309 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 ;
312327
313328 switch ( extension . type ) {
314329 case "project-shim" :
You can’t perform that action at this time.
0 commit comments