File tree Expand file tree Collapse file tree 3 files changed +42
-5
lines changed Expand file tree Collapse file tree 3 files changed +42
-5
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,28 @@ class Module {
104104 }
105105
106106 async _getSpecifications ( ) {
107- const configs = await this . _getConfigurations ( ) ;
107+ let configs = await this . _getConfigurations ( ) ;
108+
109+ // I'm using hacks here:
110+ // Filter out project-shims to check whether the this module is a collection
111+ const isCollection = configs . find ( ( configuration ) => {
112+ if ( configuration . kind === "extension" && configuration . type === "project-shim" ) {
113+ // TODO create Specification instance and ask it for the configuration
114+ if ( configuration . shims && configuration . shims . collections &&
115+ configuration . shims . collections [ this . getId ( ) ] ) {
116+ return true ;
117+ }
118+ }
119+ } ) ;
120+
121+ if ( isCollection ) {
122+ // This module is configured as a collection
123+ // For compatibility reasons with the behavior of projectPreprocessor,
124+ // the project contained in this module must be ignored
125+ configs = configs . filter ( ( configuration ) => {
126+ return configuration . kind !== "project" ;
127+ } ) ;
128+ }
108129
109130 const specs = await Promise . all ( configs . map ( async ( configuration ) => {
110131 const spec = await Specification . create ( {
Original file line number Diff line number Diff line change @@ -22,14 +22,16 @@ class ShimCollection {
2222 addProjectShim ( shimExtension ) {
2323 const name = shimExtension . getName ( ) ;
2424 log . verbose ( `Adding new shim ${ name } ...` ) ;
25- // TODO: Move this into a dedicated ShimConfiguration class?
26- const { configurations, dependencies , collections } = shimExtension . getShimConfiguration ( ) ;
25+
26+ const configurations = shimExtension . getConfigurationShims ( ) ;
2727 if ( configurations ) {
2828 addToMap ( name , configurations , this . _projectConfigShims ) ;
2929 }
30+ const dependencies = shimExtension . getDependencyShims ( ) ;
3031 if ( dependencies ) {
3132 addToMap ( name , dependencies , this . _dependencyShims ) ;
3233 }
34+ const collections = shimExtension . getCollectionShims ( ) ;
3335 if ( collections ) {
3436 addToMap ( name , collections , this . _collectionShims ) ;
3537 }
Original file line number Diff line number Diff line change @@ -10,8 +10,22 @@ class ProjectShim extends Extension {
1010 /**
1111 * @public
1212 */
13- getShimConfiguration ( ) {
14- return this . _config . shims ;
13+ getDependencyShims ( ) {
14+ return this . _config . shims . dependencies ;
15+ }
16+
17+ /**
18+ * @public
19+ */
20+ getConfigurationShims ( ) {
21+ return this . _config . shims . configurations ;
22+ }
23+
24+ /**
25+ * @public
26+ */
27+ getCollectionShims ( ) {
28+ return this . _config . shims . collections ;
1529 }
1630
1731 /* === Internals === */
You can’t perform that action at this time.
0 commit comments