-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[INTERNAL] Export build processor manifestCreator #648
Conversation
Make the build processor 'manifestCreator' accessible for external usage. JIRA: CPOUI5FOUNDATION-299
|
lib/processors/manifestCreator.js
Outdated
@@ -634,6 +634,10 @@ async function createManifest(libraryResource, libBundle, descriptorVersion, _in | |||
} | |||
} | |||
|
|||
if ( !minUI5VersionRequired ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the getVersion
function is used for more than the minUI5Version. Why not move this if into the getUI5Version
function instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See discussion below #648 (comment)
lib/processors/manifestCreator.js
Outdated
@@ -667,7 +672,8 @@ module.exports = function({libraryResource, resources, options}) { | |||
return Promise.resolve(null); // a fulfillment of null indicates that no manifest has been created | |||
} | |||
|
|||
return createManifest(libraryResource, libBundle, options.descriptorVersion, options.include3rdParty) | |||
return createManifest(libraryResource, libBundle, options.descriptorVersion, options.include3rdParty, | |||
options.minUI5VersionRequired) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a switch to simply omit the minUI5Version instead of trying to resolve it. Maybe omitMinUI5Version
?
In the ui5-server use case, there is no benefit from having the minUI5Version available in some cases. So I think it should never be available in order to keep things simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, let's call it omitMinVersions because not only the minUI5Version but also the minVersion of dependencies could lead to issues. The added versionInfoGenerator test proves that missing (empty string) minVersion/minUI5Version info doesn't affect the result of a sap-ui-version.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one remark/question in the test
}); | ||
} | ||
}; | ||
const myDep = {name: "my.dep", version: "1.2.3", libraryManifest: myDepManifest}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we actually remove myDep in this test? I guess that would be the ui5-server use case then were some dependencies might not be available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Let's wait with merging this until tomorrow afternoon when we were able to discuss the info-log that might appear for ui5 serve now. |
"Cannot find dependency 'my.dep' " + | ||
"defined in the manifest.json or .library file of project 'lib.a'. " + | ||
"This might prevent some UI5 runtime performance optimizations from taking effect. " + | ||
"Please double check your project's dependency configuration."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested this PR in conjunction with SAP/ui5-server#420 and found that this info log does not appear if no dependencies are maintained at all, since in that case no libraryInfos are supplied and therefore no manifestHints are evaluated in the versionInfoGenerator.
Overall I found that this PR does not change whether or not users will see this info logging. So we should be good to merge it.
Make the build processor 'manifestCreator' accessible
for external usage.
Add an additional option to the 'manifestCreator' to
omit processing of dependency's minVersion and
minUI5Version.
JIRA: CPOUI5FOUNDATION-299