Skip to content

Commit

Permalink
[FIX] generateFlexChangesBundle: Fix minUI5Version check for UI5 v1.1…
Browse files Browse the repository at this point in the history
…00.0+ (#706)
  • Loading branch information
thuyboehm committed Feb 21, 2022
1 parent 170c90b commit fb1217a
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 10 deletions.
5 changes: 3 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 = 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,9 @@ 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 version = semver.coerce(await readManifestMinUI5Version());
let hasFlexBundleVersion = false;
if (parseFloat(version) >= 1.73) {
if (semver.compare(version, "1.73.0") >= 0) {
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",
"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",
"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

0 comments on commit fb1217a

Please sign in to comment.