@@ -69,7 +69,7 @@ const utils = {
6969 const ui5Dependencies = [ ] ;
7070 const rootProject = projectGraph . getRoot ( ) ;
7171 await projectGraph . traverseBreadthFirst ( async ( { project} ) => {
72- if ( project . isFrameworkProject ( ) ) {
72+ if ( project !== rootProject && project . isFrameworkProject ( ) ) {
7373 // Ignoring UI5 Framework libraries in dependencies
7474 return ;
7575 }
@@ -93,7 +93,7 @@ const utils = {
9393 async declareFrameworkDependenciesInGraph ( projectGraph ) {
9494 const rootProject = projectGraph . getRoot ( ) ;
9595 await projectGraph . traverseBreadthFirst ( async ( { project} ) => {
96- if ( project . isFrameworkProject ( ) ) {
96+ if ( project !== rootProject && project . isFrameworkProject ( ) ) {
9797 // Ignoring UI5 Framework libraries in dependencies
9898 return ;
9999 }
@@ -136,20 +136,25 @@ export default {
136136 */
137137 enrichProjectGraph : async function ( projectGraph , options = { } ) {
138138 const rootProject = projectGraph . getRoot ( ) ;
139-
140- // if (rootProject.isFrameworkProject()) {
141- // rootProject.getFrameworkDependencies().forEach((dep) => {
142- // if (utils.shouldIncludeDependency(dep) && !projectGraph.getProject(dep.name)) {
143- // throw new Error(
144- // `Missing framework dependency ${dep.name} for project ${rootProject.getName()}`);
145- // }
146- // });
147- // // Ignoring UI5 Framework libraries in dependencies
148- // return projectGraph;
149- // }
150-
151139 const frameworkName = rootProject . getFrameworkName ( ) ;
152140 const frameworkVersion = rootProject . getFrameworkVersion ( ) ;
141+
142+ // It is allowed to not define a framework version in ui5.yaml but provide one via the override
143+ let version = options . versionOverride || frameworkVersion ;
144+
145+ if ( rootProject . isFrameworkProject ( ) && ( ! version || ! version . endsWith ( "-SNAPSHOT" ) ) ) {
146+ // If the root project is a framework project, and the framework version is not a
147+ // snapshot version, all framework dependencies need to be part of the graph already
148+ rootProject . getFrameworkDependencies ( ) . forEach ( ( dep ) => {
149+ if ( utils . shouldIncludeDependency ( dep ) && ! projectGraph . getProject ( dep . name ) ) {
150+ throw new Error (
151+ `Missing framework dependency ${ dep . name } for framework project ${ rootProject . getName ( ) } ` ) ;
152+ }
153+ } ) ;
154+ // All framework dependencies are already present in the graph
155+ return projectGraph ;
156+ }
157+
153158 if ( ! frameworkName && ! frameworkVersion ) {
154159 log . verbose ( `Root project ${ rootProject . getName ( ) } has no framework configuration. Nothing to do here` ) ;
155160 return projectGraph ;
@@ -162,9 +167,6 @@ export default {
162167 ) ;
163168 }
164169
165- // It is allowed to not define a framework version in ui5.yaml but provide one via the override
166- let version = options . versionOverride || frameworkVersion ;
167-
168170 if ( ! version ) {
169171 throw new Error (
170172 `No framework version defined for root project ${ rootProject . getName ( ) } `
@@ -176,7 +178,7 @@ export default {
176178 Resolver = ( await import ( "../../ui5Framework/Openui5Resolver.js" ) ) . default ;
177179 } else if ( frameworkName === "SAPUI5" ) {
178180 if ( version . endsWith ( "-SNAPSHOT" ) ) {
179- Resolver = ( await import ( "../../ui5Framework/Sapui5SnapshotResolver .js" ) ) . default ;
181+ Resolver = ( await import ( "../../ui5Framework/Sapui5MavenSnapshotResolver .js" ) ) . default ;
180182 } else {
181183 Resolver = ( await import ( "../../ui5Framework/Sapui5Resolver.js" ) ) . default ;
182184 }
0 commit comments