Skip to content
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

[FIX] generateFlexChangesBundle: Fix minUI5Version check for UI5 v1.100.0+ #706

Merged
merged 8 commits into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/tasks/bundlers/generateFlexChangesBundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const log = require("@ui5/logger").getLogger("builder:tasks:bundlers:generateFlexChangesBundle");
const flexChangesBundler = require("../../processors/bundlers/flexChangesBundler");
const {SemVer: Version} = require("semver");

/**
* Task to create changesBundle.json file containing all changes stored in the /changes folder for easier consumption
Expand Down Expand Up @@ -68,9 +69,10 @@ module.exports = async function({workspace, taskUtil, options: {namespace}}) {
const allResources = await workspace.byGlob(
`${pathPrefix}/changes/*.{change,variant,ctrl_variant,ctrl_variant_change,ctrl_variant_management_change}`);
if (allResources.length > 0) {
const version = await readManifestMinUI5Version();
const MIN_UI5_VERION_1_73 = new Version("1.73.0");
const version = new Version(await readManifestMinUI5Version());
let hasFlexBundleVersion = false;
if (parseFloat(version) >= 1.73) {
if (version.major >= MIN_UI5_VERION_1_73.major && version.minor >= MIN_UI5_VERION_1_73.minor) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could compare method be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already use

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I viewed an old version

hasFlexBundleVersion = true;
}
const processedResources = await flexChangesBundler({
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/expected/build/application.i/dest/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.72.1",
"libs": {
"sap.ui.layout": {},
"sap.ui.core": {},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.73.2",
"minUI5Version": "1.100.2",
"libs": {
"sap.ui.layout": {},
"sap.ui.core": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Component-preload.js",
"module": "application/j/Component-preload.js",
"size": 3682,
"size": 3683,
"merged": true,
"required": [
"sap/m/library.js",
Expand Down Expand Up @@ -87,7 +87,7 @@
{
"name": "manifest.json",
"module": "application/j/manifest.json",
"size": 423
"size": 424
},
{
"name": "resources.json",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/expected/build/application.j/dest/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.73.2",
"minUI5Version": "1.100.2",
"libs": {
"sap.ui.layout": {},
"sap.ui.core": {},
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/application.i/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.72.1",
"libs": {
"sap.ui.layout": {},
"sap.ui.core": {},
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/application.j/webapp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sap.ui5": {
"dependencies": {
"minUI5Version": "1.73.2",
"minUI5Version": "1.100.2",
"libs": {
"sap.ui.layout": {},
"sap.ui.core": {},
Expand Down