From de170d3a0e05a45245d18a8794e22a52892a901a Mon Sep 17 00:00:00 2001 From: Kristian Kraljic Date: Wed, 11 Dec 2019 17:58:51 +0100 Subject: [PATCH 1/7] Add included/excludedDependencies to builder When setting the buildDependencies parameter to "true" builder used to build all dependencies of the project. By adding two new parameters includedDependencies and excludedDependencies, similar to the existing included/excludedTasks parameters, one can now choose which depenendencies to include into the build. This is also useful for self-contained builds to include the built depenendy into the bundle, instead of the unbuilt source read from the file system (e.g. in case a transpile task is present). --- lib/builder/builder.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 5392cdfd1..8516e3f79 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -207,6 +207,8 @@ module.exports = { * @param {string} parameters.destPath Target path * @param {boolean} [parameters.cleanDest=false] Decides whether project should clean the target path before build * @param {boolean} [parameters.buildDependencies=false] Decides whether project dependencies are built as well + * @param {Array} [parameters.includedDependencies=[]] List of build dependencies to be included + * @param {Array} [parameters.excludedDependencies=[]] List of build dependencies to be excluded. If the wildcard '*' is provided, only the included dependencies will be built. * @param {boolean} [parameters.dev=false] Decides whether a development build should be activated (skips non-essential and time-intensive tasks) * @param {boolean} [parameters.selfContained=false] Flag to activate self contained build * @param {boolean} [parameters.jsdoc=false] Flag to activate JSDoc build @@ -217,7 +219,8 @@ module.exports = { */ async build({ tree, destPath, cleanDest = false, - buildDependencies = false, dev = false, selfContained = false, jsdoc = false, + buildDependencies = false, includedDependencies = [], excludedDependencies = [], + dev = false, selfContained = false, jsdoc = false, includedTasks = [], excludedTasks = [], devExcludeProject = [] }) { const startTime = process.hrtime(); @@ -237,11 +240,25 @@ module.exports = { const projects = {}; // Unique project index to prevent building the same project multiple times const projectWriters = {}; // Collection of memory adapters of already built libraries + function projectFilter(project) { + // if everything is included, this overrules exclude lists + if (includedDependencies.includes("*")) return true; + let test = !excludedDependencies.includes("*"); // exclude everything? + + if (test && excludedDependencies.includes(project.metadata.name)) { + test = false; + } + if (!test && includedDependencies.includes(project.metadata.name)) { + test = true; + } + + return test; + } const projectCountMarker = {}; function projectCount(project, count = 0) { if (buildDependencies) { - count = project.dependencies.reduce((depCount, depProject) => { + count = project.dependencies.filter(projectFilter).reduce((depCount, depProject) => { return projectCount(depProject, depCount); }, count); } @@ -260,7 +277,7 @@ module.exports = { if (buildDependencies) { // Build dependencies in sequence as it is far easier to detect issues and reduces // side effects or other issues such as too many open files - depPromise = project.dependencies.reduce(function(p, depProject) { + depPromise = project.dependencies.filter(projectFilter).reduce(function(p, depProject) { return p.then(() => buildProject(depProject)); }, Promise.resolve()); } else { From 2bc71c62a16dc8121e8258cefa4860bd73ff6706 Mon Sep 17 00:00:00 2001 From: Kristian Kraljic Date: Wed, 11 Dec 2019 17:59:30 +0100 Subject: [PATCH 2/7] Prepare to deprecate buildDependencies /w 2.0 After introducting included/excludedDependencies w/ commit 48cd30d, the buildDependencies parameter is no longer required. To build all dependencies excludedDependencies can be set to an empty array, to build no dependencies (default) excludedDependencies can be set to ["*"] This change prepares the deprecation of the parameter, by introducing a warning when buildDependencies is set (commented at the moment, as buildDependencies is still used by many internal dependencies) and by setting the new parameters feature comatible if buildDependencies is set --- lib/builder/builder.js | 54 ++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 8516e3f79..783eb7c54 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -219,13 +219,33 @@ module.exports = { */ async build({ tree, destPath, cleanDest = false, - buildDependencies = false, includedDependencies = [], excludedDependencies = [], + buildDependencies = false, includedDependencies, excludedDependencies, dev = false, selfContained = false, jsdoc = false, includedTasks = [], excludedTasks = [], devExcludeProject = [] }) { + if (buildDependencies) { + // TODO <2.0: Uncomment the warning below to prepare deprecation + // TODO 2.0: Remove deprecated "buildDependencies" parameter and set the default of + // includedDependencies to [] and, excludedDependencies to ["*"] for feature parity + // log.warn(`builder.build called with deprecated parameter "buildDependencies". ` + + // `This parameter will be removed in @ui5/builder version 2.0. ` + + // `Use parameters "includedDependencies" and "excludedDependencies" instead`);*/ + } + if (buildDependencies && (includedDependencies || excludedDependencies)) { + throw new Error( + `builder.build called with parameters "buildDependencies" and ` + + `"includedDependencies" / "excludedDependencies". Please provide only one of the two.`); + } else if (includedDependencies || excludedDependencies) { + // as we don't set a default yet (because of the deprecation of buildDependencies), we have to check: + if (!includedDependencies) includedDependencies = []; + if (!excludedDependencies) excludedDependencies = []; + } else { + includedDependencies = []; + excludedDependencies = buildDependencies ? [] : ["*"]; + } + const startTime = process.hrtime(); - log.info(`Building project ${tree.metadata.name}` + (buildDependencies ? "" : " not") + - " including dependencies..." + (dev ? " [dev mode]" : "")); + log.info(`Building project ${tree.metadata.name}` + (dev ? " [dev mode]" : "")); log.verbose(`Building to ${destPath}...`); const selectedTasks = composeTaskList({dev, selfContained, jsdoc, includedTasks, excludedTasks}); @@ -257,32 +277,26 @@ module.exports = { const projectCountMarker = {}; function projectCount(project, count = 0) { - if (buildDependencies) { - count = project.dependencies.filter(projectFilter).reduce((depCount, depProject) => { - return projectCount(depProject, depCount); - }, count); - } + count = project.dependencies.filter(projectFilter).reduce((depCount, depProject) => { + return projectCount(depProject, depCount); + }, count); if (!projectCountMarker[project.metadata.name]) { count++; projectCountMarker[project.metadata.name] = true; } return count; } - const iProjectCount = projectCount(tree); - const buildLogger = log.createTaskLogger("🛠 ", iProjectCount); + const buildLogger = log.createTaskLogger("🛠 ", projectCount(tree)); function buildProject(project) { - let depPromise; let projectTasks = selectedTasks; - if (buildDependencies) { - // Build dependencies in sequence as it is far easier to detect issues and reduces - // side effects or other issues such as too many open files - depPromise = project.dependencies.filter(projectFilter).reduce(function(p, depProject) { - return p.then(() => buildProject(depProject)); - }, Promise.resolve()); - } else { - depPromise = Promise.resolve(); - } + + // Build dependencies in sequence as it is far easier to detect issues and reduces + // side effects or other issues such as too many open files + const depPromise = project.dependencies.filter(projectFilter).reduce(function(p, depProject) { + return p.then(() => buildProject(depProject)); + }, Promise.resolve()); + // Build the project after all dependencies have been built return depPromise.then(() => { if (projects[project.metadata.name]) { From 1ea11444e4eecf513bbd375f95711d290ea24bc9 Mon Sep 17 00:00:00 2001 From: Kristian Kraljic Date: Thu, 12 Dec 2019 09:55:00 +0100 Subject: [PATCH 3/7] Add tests for builder w/ buildDeps & selfContained This change adds tests to builder for bulding bundles using parameters buildDependencies, included/excludedDependencies, selfContained and a combination thereof. All these have previously been untested. --- lib/builder/builder.js | 4 +- .../build/application.a/dest-deps/index.html | 11 + .../dest-deps/resources/library/d/.library | 11 + .../resources/library/d/manifest.json | 28 +++ .../dest-deps/resources/library/d/some-dbg.js | 7 + .../dest-deps/resources/library/d/some.js | 4 + .../dest-deps/resources/ui5loader-dbg.js | 1 + .../dest-deps/resources/ui5loader.js | 0 .../build/application.a/dest-deps/test-dbg.js | 9 + .../test-resources/library/d/Test.html | 0 .../build/application.a/dest-deps/test.js | 1 + .../application.a/dest-depself/index.html | 11 + .../dest-depself/resources/library/d/.library | 11 + .../resources/library/d/manifest.json | 28 +++ .../resources/library/d/some-dbg.js | 7 + .../dest-depself/resources/library/d/some.js | 4 + .../resources/sap-ui-custom-dbg.js | 1 + .../dest-depself/resources/sap-ui-custom.js | 10 + .../dest-depself/resources/ui5loader-dbg.js | 1 + .../dest-depself/resources/ui5loader.js | 0 .../application.a/dest-depself/test-dbg.js | 9 + .../test-resources/library/d/Test.html | 0 .../build/application.a/dest-depself/test.js | 1 + .../build/application.a/dest-dev/index.html | 2 + .../build/application.a/dest-dev/test.js | 14 +- .../build/application.a/dest-self/index.html | 11 + .../dest-self/resources/sap-ui-custom-dbg.js | 1 + .../dest-self/resources/sap-ui-custom.js | 10 + .../build/application.a/dest-self/test-dbg.js | 9 + .../build/application.a/dest-self/test.js | 1 + .../build/application.a/dest/index.html | 2 + .../build/application.a/dest/test-dbg.js | 14 +- .../expected/build/application.a/dest/test.js | 2 +- .../dest/resources/library/d/some-dbg.js | 5 +- .../dest/resources/library/d/some.js | 2 +- .../resources/library/d/library-preload.js | 2 +- .../preload/resources/library/d/some.js | 5 +- test/fixtures/application.a/webapp/index.html | 2 + test/fixtures/application.a/webapp/test.js | 14 +- .../library.d/main/src/library/d/some.js | 5 +- test/lib/builder/builder.js | 224 ++++++++++++------ 41 files changed, 395 insertions(+), 89 deletions(-) create mode 100644 test/expected/build/application.a/dest-deps/index.html create mode 100644 test/expected/build/application.a/dest-deps/resources/library/d/.library create mode 100644 test/expected/build/application.a/dest-deps/resources/library/d/manifest.json create mode 100644 test/expected/build/application.a/dest-deps/resources/library/d/some-dbg.js create mode 100644 test/expected/build/application.a/dest-deps/resources/library/d/some.js create mode 100644 test/expected/build/application.a/dest-deps/resources/ui5loader-dbg.js create mode 100644 test/expected/build/application.a/dest-deps/resources/ui5loader.js create mode 100644 test/expected/build/application.a/dest-deps/test-dbg.js create mode 100644 test/expected/build/application.a/dest-deps/test-resources/library/d/Test.html create mode 100644 test/expected/build/application.a/dest-deps/test.js create mode 100644 test/expected/build/application.a/dest-depself/index.html create mode 100644 test/expected/build/application.a/dest-depself/resources/library/d/.library create mode 100644 test/expected/build/application.a/dest-depself/resources/library/d/manifest.json create mode 100644 test/expected/build/application.a/dest-depself/resources/library/d/some-dbg.js create mode 100644 test/expected/build/application.a/dest-depself/resources/library/d/some.js create mode 100644 test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js create mode 100644 test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js create mode 100644 test/expected/build/application.a/dest-depself/resources/ui5loader-dbg.js create mode 100644 test/expected/build/application.a/dest-depself/resources/ui5loader.js create mode 100644 test/expected/build/application.a/dest-depself/test-dbg.js create mode 100644 test/expected/build/application.a/dest-depself/test-resources/library/d/Test.html create mode 100644 test/expected/build/application.a/dest-depself/test.js create mode 100644 test/expected/build/application.a/dest-self/index.html create mode 100644 test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js create mode 100644 test/expected/build/application.a/dest-self/resources/sap-ui-custom.js create mode 100644 test/expected/build/application.a/dest-self/test-dbg.js create mode 100644 test/expected/build/application.a/dest-self/test.js diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 783eb7c54..748745440 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -277,7 +277,7 @@ module.exports = { const projectCountMarker = {}; function projectCount(project, count = 0) { - count = project.dependencies.filter(projectFilter).reduce((depCount, depProject) => { + count = (project.dependencies || []).filter(projectFilter).reduce((depCount, depProject) => { return projectCount(depProject, depCount); }, count); if (!projectCountMarker[project.metadata.name]) { @@ -293,7 +293,7 @@ module.exports = { // Build dependencies in sequence as it is far easier to detect issues and reduces // side effects or other issues such as too many open files - const depPromise = project.dependencies.filter(projectFilter).reduce(function(p, depProject) { + const depPromise = (project.dependencies || []).filter(projectFilter).reduce(function(p, depProject) { return p.then(() => buildProject(depProject)); }, Promise.resolve()); diff --git a/test/expected/build/application.a/dest-deps/index.html b/test/expected/build/application.a/dest-deps/index.html new file mode 100644 index 000000000..1523b1dc3 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/index.html @@ -0,0 +1,11 @@ + + + + Application A + + + + + + \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/library/d/.library b/test/expected/build/application.a/dest-deps/resources/library/d/.library new file mode 100644 index 000000000..d6a612a92 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/d/.library @@ -0,0 +1,11 @@ + + + + library.d + SAP SE + Some fancy copyright + 1.0.0 + + Library D + + diff --git a/test/expected/build/application.a/dest-deps/resources/library/d/manifest.json b/test/expected/build/application.a/dest-deps/resources/library/d/manifest.json new file mode 100644 index 000000000..4ad3d1aef --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/d/manifest.json @@ -0,0 +1,28 @@ +{ + "_version": "1.9.0", + "sap.app": { + "id": "library.d", + "type": "library", + "embeds": [], + "applicationVersion": { + "version": "1.0.0" + }, + "title": "Library D", + "description": "Library D", + "resources": "resources.json", + "offline": true + }, + "sap.ui": { + "technology": "UI5", + "supportedThemes": [] + }, + "sap.ui5": { + "dependencies": { + "minUI5Version": "1.0", + "libs": {} + }, + "library": { + "i18n": false + } + } +} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/library/d/some-dbg.js b/test/expected/build/application.a/dest-deps/resources/library/d/some-dbg.js new file mode 100644 index 000000000..1e8c6a2f9 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/d/some-dbg.js @@ -0,0 +1,7 @@ +/*! + * Some fancy copyright + */ +(function() { + var someNonUglifiedVariable = "World"; + console.log('Hello ' + someNonUglifiedVariable); +})(); diff --git a/test/expected/build/application.a/dest-deps/resources/library/d/some.js b/test/expected/build/application.a/dest-deps/resources/library/d/some.js new file mode 100644 index 000000000..c23f5f207 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/d/some.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/ui5loader-dbg.js b/test/expected/build/application.a/dest-deps/resources/ui5loader-dbg.js new file mode 100644 index 000000000..0e76321fd --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/ui5loader-dbg.js @@ -0,0 +1 @@ +// this is just a marker file to enable the EVO bundle format diff --git a/test/expected/build/application.a/dest-deps/resources/ui5loader.js b/test/expected/build/application.a/dest-deps/resources/ui5loader.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps/test-dbg.js b/test/expected/build/application.a/dest-deps/test-dbg.js new file mode 100644 index 000000000..cb4595405 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/test-dbg.js @@ -0,0 +1,9 @@ +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/application.a/dest-deps/test-resources/library/d/Test.html b/test/expected/build/application.a/dest-deps/test-resources/library/d/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps/test.js b/test/expected/build/application.a/dest-deps/test.js new file mode 100644 index 000000000..fd8278c6e --- /dev/null +++ b/test/expected/build/application.a/dest-deps/test.js @@ -0,0 +1 @@ +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/index.html b/test/expected/build/application.a/dest-depself/index.html new file mode 100644 index 000000000..b0c4c25b7 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/index.html @@ -0,0 +1,11 @@ + + + + Application A + + + + + + \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/library/d/.library b/test/expected/build/application.a/dest-depself/resources/library/d/.library new file mode 100644 index 000000000..d6a612a92 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/d/.library @@ -0,0 +1,11 @@ + + + + library.d + SAP SE + Some fancy copyright + 1.0.0 + + Library D + + diff --git a/test/expected/build/application.a/dest-depself/resources/library/d/manifest.json b/test/expected/build/application.a/dest-depself/resources/library/d/manifest.json new file mode 100644 index 000000000..4ad3d1aef --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/d/manifest.json @@ -0,0 +1,28 @@ +{ + "_version": "1.9.0", + "sap.app": { + "id": "library.d", + "type": "library", + "embeds": [], + "applicationVersion": { + "version": "1.0.0" + }, + "title": "Library D", + "description": "Library D", + "resources": "resources.json", + "offline": true + }, + "sap.ui": { + "technology": "UI5", + "supportedThemes": [] + }, + "sap.ui5": { + "dependencies": { + "minUI5Version": "1.0", + "libs": {} + }, + "library": { + "i18n": false + } + } +} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/library/d/some-dbg.js b/test/expected/build/application.a/dest-depself/resources/library/d/some-dbg.js new file mode 100644 index 000000000..1e8c6a2f9 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/d/some-dbg.js @@ -0,0 +1,7 @@ +/*! + * Some fancy copyright + */ +(function() { + var someNonUglifiedVariable = "World"; + console.log('Hello ' + someNonUglifiedVariable); +})(); diff --git a/test/expected/build/application.a/dest-depself/resources/library/d/some.js b/test/expected/build/application.a/dest-depself/resources/library/d/some.js new file mode 100644 index 000000000..c23f5f207 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/d/some.js @@ -0,0 +1,4 @@ +/*! + * Some fancy copyright + */ +(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js new file mode 100644 index 000000000..456319972 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom-dbg.js @@ -0,0 +1 @@ +//@ui5-bundle sap-ui-custom-dbg.js diff --git a/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js new file mode 100644 index 000000000..c1aee5600 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/sap-ui-custom.js @@ -0,0 +1,10 @@ +//@ui5-bundle sap-ui-custom.js +sap.ui.require.preload({ + "application/a/test.js":function(){sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +}, + "library/d/some.js":function(){/*! + * Some fancy copyright + */ +(function(){var o="World";console.log("Hello "+o)})(); +} +}); diff --git a/test/expected/build/application.a/dest-depself/resources/ui5loader-dbg.js b/test/expected/build/application.a/dest-depself/resources/ui5loader-dbg.js new file mode 100644 index 000000000..0e76321fd --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/ui5loader-dbg.js @@ -0,0 +1 @@ +// this is just a marker file to enable the EVO bundle format diff --git a/test/expected/build/application.a/dest-depself/resources/ui5loader.js b/test/expected/build/application.a/dest-depself/resources/ui5loader.js new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-depself/test-dbg.js b/test/expected/build/application.a/dest-depself/test-dbg.js new file mode 100644 index 000000000..cb4595405 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/test-dbg.js @@ -0,0 +1,9 @@ +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/application.a/dest-depself/test-resources/library/d/Test.html b/test/expected/build/application.a/dest-depself/test-resources/library/d/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-depself/test.js b/test/expected/build/application.a/dest-depself/test.js new file mode 100644 index 000000000..fd8278c6e --- /dev/null +++ b/test/expected/build/application.a/dest-depself/test.js @@ -0,0 +1 @@ +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-dev/index.html b/test/expected/build/application.a/dest-dev/index.html index 77b0207cc..1523b1dc3 100644 --- a/test/expected/build/application.a/dest-dev/index.html +++ b/test/expected/build/application.a/dest-dev/index.html @@ -2,6 +2,8 @@ Application A + diff --git a/test/expected/build/application.a/dest-dev/test.js b/test/expected/build/application.a/dest-dev/test.js index a3df410c3..cb4595405 100644 --- a/test/expected/build/application.a/dest-dev/test.js +++ b/test/expected/build/application.a/dest-dev/test.js @@ -1,5 +1,9 @@ -function test(paramA) { - var variableA = paramA; - console.log(variableA); -} -test(); +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/application.a/dest-self/index.html b/test/expected/build/application.a/dest-self/index.html new file mode 100644 index 000000000..b0c4c25b7 --- /dev/null +++ b/test/expected/build/application.a/dest-self/index.html @@ -0,0 +1,11 @@ + + + + Application A + + + + + + \ No newline at end of file diff --git a/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js b/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js new file mode 100644 index 000000000..456319972 --- /dev/null +++ b/test/expected/build/application.a/dest-self/resources/sap-ui-custom-dbg.js @@ -0,0 +1 @@ +//@ui5-bundle sap-ui-custom-dbg.js diff --git a/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js b/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js new file mode 100644 index 000000000..7728d6932 --- /dev/null +++ b/test/expected/build/application.a/dest-self/resources/sap-ui-custom.js @@ -0,0 +1,10 @@ +//@ui5-bundle sap-ui-custom.js +sap.ui.require.preload({ + "application/a/test.js":function(){sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); +}, + "library/d/some.js":function(){/*! + * ${copyright} + */ +(function(){var o="World";console.log("Hello "+o)})(); +} +}); diff --git a/test/expected/build/application.a/dest-self/test-dbg.js b/test/expected/build/application.a/dest-self/test-dbg.js new file mode 100644 index 000000000..cb4595405 --- /dev/null +++ b/test/expected/build/application.a/dest-self/test-dbg.js @@ -0,0 +1,9 @@ +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/application.a/dest-self/test.js b/test/expected/build/application.a/dest-self/test.js new file mode 100644 index 000000000..fd8278c6e --- /dev/null +++ b/test/expected/build/application.a/dest-self/test.js @@ -0,0 +1 @@ +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.a/dest/index.html b/test/expected/build/application.a/dest/index.html index 77b0207cc..1523b1dc3 100644 --- a/test/expected/build/application.a/dest/index.html +++ b/test/expected/build/application.a/dest/index.html @@ -2,6 +2,8 @@ Application A + diff --git a/test/expected/build/application.a/dest/test-dbg.js b/test/expected/build/application.a/dest/test-dbg.js index a3df410c3..cb4595405 100644 --- a/test/expected/build/application.a/dest/test-dbg.js +++ b/test/expected/build/application.a/dest/test-dbg.js @@ -1,5 +1,9 @@ -function test(paramA) { - var variableA = paramA; - console.log(variableA); -} -test(); +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/application.a/dest/test.js b/test/expected/build/application.a/dest/test.js index 387af3930..fd8278c6e 100644 --- a/test/expected/build/application.a/dest/test.js +++ b/test/expected/build/application.a/dest/test.js @@ -1 +1 @@ -function test(t){var o=t;console.log(o)}test(); \ No newline at end of file +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/library.d/dest/resources/library/d/some-dbg.js b/test/expected/build/library.d/dest/resources/library/d/some-dbg.js index cb7722a38..1e8c6a2f9 100644 --- a/test/expected/build/library.d/dest/resources/library/d/some-dbg.js +++ b/test/expected/build/library.d/dest/resources/library/d/some-dbg.js @@ -1,4 +1,7 @@ /*! * Some fancy copyright */ -console.log('HelloWorld'); \ No newline at end of file +(function() { + var someNonUglifiedVariable = "World"; + console.log('Hello ' + someNonUglifiedVariable); +})(); diff --git a/test/expected/build/library.d/dest/resources/library/d/some.js b/test/expected/build/library.d/dest/resources/library/d/some.js index a5504d866..c23f5f207 100644 --- a/test/expected/build/library.d/dest/resources/library/d/some.js +++ b/test/expected/build/library.d/dest/resources/library/d/some.js @@ -1,4 +1,4 @@ /*! * Some fancy copyright */ -console.log("HelloWorld"); \ No newline at end of file +(function(){var o="World";console.log("Hello "+o)})(); \ No newline at end of file diff --git a/test/expected/build/library.d/preload/resources/library/d/library-preload.js b/test/expected/build/library.d/preload/resources/library/d/library-preload.js index 807feb583..3a8e66b86 100644 --- a/test/expected/build/library.d/preload/resources/library/d/library-preload.js +++ b/test/expected/build/library.d/preload/resources/library/d/library-preload.js @@ -5,6 +5,6 @@ jQuery.sap.registerPreloadedModules({ "library/d/some.js":function(){/*! * ${copyright} */ -console.log("HelloWorld"); +(function(){var o="World";console.log("Hello "+o)})(); } }}); diff --git a/test/expected/build/library.d/preload/resources/library/d/some.js b/test/expected/build/library.d/preload/resources/library/d/some.js index 81e734360..fa1d786f7 100644 --- a/test/expected/build/library.d/preload/resources/library/d/some.js +++ b/test/expected/build/library.d/preload/resources/library/d/some.js @@ -1,4 +1,7 @@ /*! * ${copyright} */ -console.log('HelloWorld'); \ No newline at end of file +(function() { + var someNonUglifiedVariable = "World"; + console.log('Hello ' + someNonUglifiedVariable); +})(); diff --git a/test/fixtures/application.a/webapp/index.html b/test/fixtures/application.a/webapp/index.html index 77b0207cc..1523b1dc3 100644 --- a/test/fixtures/application.a/webapp/index.html +++ b/test/fixtures/application.a/webapp/index.html @@ -2,6 +2,8 @@ Application A + diff --git a/test/fixtures/application.a/webapp/test.js b/test/fixtures/application.a/webapp/test.js index a3df410c3..cb4595405 100644 --- a/test/fixtures/application.a/webapp/test.js +++ b/test/fixtures/application.a/webapp/test.js @@ -1,5 +1,9 @@ -function test(paramA) { - var variableA = paramA; - console.log(variableA); -} -test(); +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/fixtures/library.d/main/src/library/d/some.js b/test/fixtures/library.d/main/src/library/d/some.js index 81e734360..fa1d786f7 100644 --- a/test/fixtures/library.d/main/src/library/d/some.js +++ b/test/fixtures/library.d/main/src/library/d/some.js @@ -1,4 +1,7 @@ /*! * ${copyright} */ -console.log('HelloWorld'); \ No newline at end of file +(function() { + var someNonUglifiedVariable = "World"; + console.log('Hello ' + someNonUglifiedVariable); +})(); diff --git a/test/lib/builder/builder.js b/test/lib/builder/builder.js index fb64572b2..70ebbd440 100644 --- a/test/lib/builder/builder.js +++ b/test/lib/builder/builder.js @@ -98,7 +98,6 @@ test("Build application.a", (t) => { }); }); - test("Build application.a with error", async (t) => { const destPath = "./test/tmp/build/application.a/dest"; @@ -109,6 +108,122 @@ test("Build application.a with error", async (t) => { t.deepEqual(error.message, `Unknown type 'non existent'`); }); +test("Build application.a with dependencies", (t) => { + const destPath = "./test/tmp/build/application.a/dest-deps"; + const expectedPath = path.join("test", "expected", "build", "application.a", "dest-deps"); + + return builder.build({ + tree: applicationATree, + destPath, + excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"], + buildDependencies: true + }).then(() => { + return findFiles(expectedPath); + }).then((expectedFiles) => { + // Check for all directories and files + assert.directoryDeepEqual(destPath, expectedPath); + // Check for all file contents + return checkFileContentsIgnoreLineFeeds(expectedFiles, expectedPath, destPath); + }).then(() => { + t.pass(); + }); +}); + +test("Build application.a with dependencies include", (t) => { + const destPath = "./test/tmp/build/application.a/dest-deps-incl"; + const expectedPath = path.join("test", "expected", "build", "application.a", "dest-deps"); + + return builder.build({ + tree: applicationATree, + destPath, + excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"], + includedDependencies: ["*"] + }).then(() => { + return findFiles(expectedPath); + }).then((expectedFiles) => { + // Check for all directories and files + assert.directoryDeepEqual(destPath, expectedPath); + // Check for all file contents + return checkFileContentsIgnoreLineFeeds(expectedFiles, expectedPath, destPath); + }).then(() => { + t.pass(); + }); +}); + +test("Build application.a with dependencies exclude", (t) => { + const destPath = "./test/tmp/build/application.a/dest-deps-excl"; + const expectedPath = path.join("test", "expected", "build", "application.a", "dest"); + + return builder.build({ + tree: applicationATree, + destPath, + excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"], + excludedDependencies: ["library.d"] + }).then(() => { + return findFiles(expectedPath); + }).then((expectedFiles) => { + // Check for all directories and files + assert.directoryDeepEqual(destPath, expectedPath); + // Check for all file contents + return checkFileContentsIgnoreLineFeeds(expectedFiles, expectedPath, destPath); + }).then(() => { + t.pass(); + }); +}); + +test("Build application.a self-contained", (t) => { + const destPath = "./test/tmp/build/application.a/dest-self"; + const expectedPath = path.join("test", "expected", "build", "application.a", "dest-self"); + + return builder.build({ + tree: applicationATree, + destPath, + excludedTasks: ["generateComponentPreload", "generateVersionInfo"], + selfContained: true + }).then(() => { + return findFiles(expectedPath); + }).then((expectedFiles) => { + // Check for all directories and files + assert.directoryDeepEqual(destPath, expectedPath); + // Check for all file contents + return checkFileContentsIgnoreLineFeeds(expectedFiles, expectedPath, destPath); + }).then(() => { + t.pass(); + }); +}); + +test("Build application.a with dependencies self-contained", (t) => { + const destPath = "./test/tmp/build/application.a/dest-depself"; + const expectedPath = path.join("test", "expected", "build", "application.a", "dest-depself"); + + return builder.build({ + tree: applicationATree, + destPath, + excludedTasks: ["generateComponentPreload", "generateVersionInfo", "escapeNonAsciiCharacters"], + buildDependencies: true, + selfContained: true + }).then(() => { + return findFiles(expectedPath); + }).then((expectedFiles) => { + // Check for all directories and files + assert.directoryDeepEqual(destPath, expectedPath); + // Check for all file contents + return checkFileContentsIgnoreLineFeeds(expectedFiles, expectedPath, destPath); + }).then(() => { + t.pass(); + }); +}); + +test("Build application.a with deprecated parameters", async (t) => { + const destPath = "./test/tmp/build/application.a/dest"; + + await t.throwsAsync(builder.build({ + tree: applicationATree, + destPath, + buildDependencies: true, includedDependencies: [], excludedDependencies: [] + }), /^builder.build called with parameters.*/); +}); + test("Build application.a [dev mode]", (t) => { const destPath = "./test/tmp/build/application.a/dest-dev"; const expectedPath = path.join("test", "expected", "build", "application.a", "dest-dev"); @@ -462,37 +577,66 @@ test.serial("Cleanup", async (t) => { t.deepEqual(executeCleanupTasksStub.callCount, 2, "Cleanup called twice"); }); -const applicationATree = { - "id": "application.a", + +const libraryDTree = { + "id": "library.d", "version": "1.0.0", - "path": applicationAPath, + "path": libraryDPath, "dependencies": [ { - "id": "library.d", + "id": "sap.ui.core-evo", "version": "1.0.0", - "path": path.join(applicationAPath, "node_modules", "library.d"), + "path": libraryCore, "dependencies": [], "_level": 1, "specVersion": "0.1", "type": "library", "metadata": { - "name": "library.d", - "namespace": "library/d", + "name": "sap.ui.core", + "namespace": "sap/ui/core", "copyright": "Some fancy copyright" }, "resources": { "configuration": { "paths": { - "src": "main/src", - "test": "main/test" + "src": "main/src" } }, "pathMappings": { - "/resources/": "main/src", - "/test-resources/": "main/test" + "/resources/": "main/src" } } + } + ], + "_level": 0, + "specVersion": "0.1", + "type": "library", + "metadata": { + "name": "library.d", + "namespace": "library/d", + "copyright": "Some fancy copyright" + }, + "resources": { + "configuration": { + "paths": { + "src": "main/src", + "test": "main/test" + }, + "propertiesFileSourceEncoding": "ISO-8859-1" }, + "pathMappings": { + "/resources/": "main/src", + "/test-resources/": "main/test" + } + } +}; + +const applicationATree = { + "id": "application.a", + "version": "1.0.0", + "path": applicationAPath, + "dependencies": [ + libraryDTree, { "id": "library.a", "version": "1.0.0", @@ -576,7 +720,8 @@ const applicationATree = { "specVersion": "0.1", "type": "application", "metadata": { - "name": "application.a" + "name": "application.a", + "namespace": "application/a" }, "resources": { "configuration": { @@ -835,59 +980,6 @@ const applicationJTree = { } }; -const libraryDTree = { - "id": "library.d", - "version": "1.0.0", - "path": libraryDPath, - "dependencies": [ - { - "id": "sap.ui.core-evo", - "version": "1.0.0", - "path": libraryCore, - "dependencies": [], - "_level": 1, - "specVersion": "0.1", - "type": "library", - "metadata": { - "name": "sap.ui.core", - "namespace": "sap/ui/core", - "copyright": "Some fancy copyright" - }, - "resources": { - "configuration": { - "paths": { - "src": "main/src" - } - }, - "pathMappings": { - "/resources/": "main/src" - } - } - } - ], - "_level": 0, - "specVersion": "0.1", - "type": "library", - "metadata": { - "name": "library.d", - "namespace": "library/d", - "copyright": "Some fancy copyright" - }, - "resources": { - "configuration": { - "paths": { - "src": "main/src", - "test": "main/test" - }, - "propertiesFileSourceEncoding": "ISO-8859-1" - }, - "pathMappings": { - "/resources/": "main/src", - "/test-resources/": "main/test" - } - } -}; - const libraryETree = { "id": "library.e", "version": "1.0.0", From 836b0e9818e6c0bb23dab3682597cc5ce590ed1b Mon Sep 17 00:00:00 2001 From: Kristian Kraljic Date: Thu, 12 Dec 2019 19:18:47 +0100 Subject: [PATCH 4/7] Allow RegExp for included/excludedTasks This comes in handy, e.g. in case all UI5 libraries should be excluded from the build (excludedDependencies=[/^sap\.ui\./]) --- lib/builder/builder.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 748745440..c52b3087b 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -261,14 +261,19 @@ module.exports = { const projects = {}; // Unique project index to prevent building the same project multiple times const projectWriters = {}; // Collection of memory adapters of already built libraries function projectFilter(project) { + function projectMatchesAny(deps) { + return deps.some((dep) => dep instanceof RegExp ? + dep.test(project.metadata.name) : dep === project.metadata.name); + } + // if everything is included, this overrules exclude lists if (includedDependencies.includes("*")) return true; let test = !excludedDependencies.includes("*"); // exclude everything? - if (test && excludedDependencies.includes(project.metadata.name)) { + if (test && projectMatchesAny(excludedDependencies)) { test = false; } - if (!test && includedDependencies.includes(project.metadata.name)) { + if (!test && projectMatchesAny(includedDependencies)) { test = true; } From 7127e939b4df51ea0bcd7a28b5586e6d33f7444d Mon Sep 17 00:00:00 2001 From: Kristian Kraljic Date: Fri, 13 Dec 2019 08:55:56 +0100 Subject: [PATCH 5/7] Add buildDependencies parameter (revert 2bc71c6) During usage of the builder having the buildDependencies parameter still in place, eventhough solely having included/excludedDependencies *could* replace the parameter, was prooven to be more intuitive. a) Leaving the parameter as is, won't break any existing implementation b) Setting the flag to true and *then* defining the includes / excludes somehow feel "more natural" c) Due to the default beeing set to an empty array, the logic in builder must not filter any dependencies if buildDependencies is set to false --- lib/builder/builder.js | 49 ++++++++++++++----------------------- test/lib/builder/builder.js | 14 ++--------- 2 files changed, 20 insertions(+), 43 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index c52b3087b..ef359658b 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -207,8 +207,8 @@ module.exports = { * @param {string} parameters.destPath Target path * @param {boolean} [parameters.cleanDest=false] Decides whether project should clean the target path before build * @param {boolean} [parameters.buildDependencies=false] Decides whether project dependencies are built as well - * @param {Array} [parameters.includedDependencies=[]] List of build dependencies to be included - * @param {Array} [parameters.excludedDependencies=[]] List of build dependencies to be excluded. If the wildcard '*' is provided, only the included dependencies will be built. + * @param {Array} [parameters.includedDependencies=[]] List of build dependencies to be included if buildDependencies is true + * @param {Array} [parameters.excludedDependencies=[]] List of build dependencies to be excluded if buildDependencies is true. If the wildcard '*' is provided, only the included dependencies will be built. * @param {boolean} [parameters.dev=false] Decides whether a development build should be activated (skips non-essential and time-intensive tasks) * @param {boolean} [parameters.selfContained=false] Flag to activate self contained build * @param {boolean} [parameters.jsdoc=false] Flag to activate JSDoc build @@ -219,33 +219,13 @@ module.exports = { */ async build({ tree, destPath, cleanDest = false, - buildDependencies = false, includedDependencies, excludedDependencies, + buildDependencies = false, includedDependencies = [], excludedDependencies = [], dev = false, selfContained = false, jsdoc = false, includedTasks = [], excludedTasks = [], devExcludeProject = [] }) { - if (buildDependencies) { - // TODO <2.0: Uncomment the warning below to prepare deprecation - // TODO 2.0: Remove deprecated "buildDependencies" parameter and set the default of - // includedDependencies to [] and, excludedDependencies to ["*"] for feature parity - // log.warn(`builder.build called with deprecated parameter "buildDependencies". ` + - // `This parameter will be removed in @ui5/builder version 2.0. ` + - // `Use parameters "includedDependencies" and "excludedDependencies" instead`);*/ - } - if (buildDependencies && (includedDependencies || excludedDependencies)) { - throw new Error( - `builder.build called with parameters "buildDependencies" and ` + - `"includedDependencies" / "excludedDependencies". Please provide only one of the two.`); - } else if (includedDependencies || excludedDependencies) { - // as we don't set a default yet (because of the deprecation of buildDependencies), we have to check: - if (!includedDependencies) includedDependencies = []; - if (!excludedDependencies) excludedDependencies = []; - } else { - includedDependencies = []; - excludedDependencies = buildDependencies ? [] : ["*"]; - } - const startTime = process.hrtime(); - log.info(`Building project ${tree.metadata.name}` + (dev ? " [dev mode]" : "")); + log.info(`Building project ${tree.metadata.name}` + (buildDependencies ? "" : " not") + + " including dependencies..." + (dev ? " [dev mode]" : "")); log.verbose(`Building to ${destPath}...`); const selectedTasks = composeTaskList({dev, selfContained, jsdoc, includedTasks, excludedTasks}); @@ -282,9 +262,11 @@ module.exports = { const projectCountMarker = {}; function projectCount(project, count = 0) { - count = (project.dependencies || []).filter(projectFilter).reduce((depCount, depProject) => { - return projectCount(depProject, depCount); - }, count); + if (buildDependencies) { + count = (project.dependencies || []).filter(projectFilter).reduce((depCount, depProject) => { + return projectCount(depProject, depCount); + }, count); + } if (!projectCountMarker[project.metadata.name]) { count++; projectCountMarker[project.metadata.name] = true; @@ -294,13 +276,18 @@ module.exports = { const buildLogger = log.createTaskLogger("🛠 ", projectCount(tree)); function buildProject(project) { + let depPromise; let projectTasks = selectedTasks; // Build dependencies in sequence as it is far easier to detect issues and reduces // side effects or other issues such as too many open files - const depPromise = (project.dependencies || []).filter(projectFilter).reduce(function(p, depProject) { - return p.then(() => buildProject(depProject)); - }, Promise.resolve()); + if (buildDependencies) { + depPromise = (project.dependencies || []).filter(projectFilter).reduce(function(p, depProject) { + return p.then(() => buildProject(depProject)); + }, Promise.resolve()); + } else { + depPromise = Promise.resolve(); + } // Build the project after all dependencies have been built return depPromise.then(() => { diff --git a/test/lib/builder/builder.js b/test/lib/builder/builder.js index 70ebbd440..55f9754a6 100644 --- a/test/lib/builder/builder.js +++ b/test/lib/builder/builder.js @@ -137,7 +137,7 @@ test("Build application.a with dependencies include", (t) => { tree: applicationATree, destPath, excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"], - includedDependencies: ["*"] + buildDependencies: true, includedDependencies: ["*"] }).then(() => { return findFiles(expectedPath); }).then((expectedFiles) => { @@ -158,7 +158,7 @@ test("Build application.a with dependencies exclude", (t) => { tree: applicationATree, destPath, excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"], - excludedDependencies: ["library.d"] + buildDependencies: true, excludedDependencies: ["library.d"] }).then(() => { return findFiles(expectedPath); }).then((expectedFiles) => { @@ -214,16 +214,6 @@ test("Build application.a with dependencies self-contained", (t) => { }); }); -test("Build application.a with deprecated parameters", async (t) => { - const destPath = "./test/tmp/build/application.a/dest"; - - await t.throwsAsync(builder.build({ - tree: applicationATree, - destPath, - buildDependencies: true, includedDependencies: [], excludedDependencies: [] - }), /^builder.build called with parameters.*/); -}); - test("Build application.a [dev mode]", (t) => { const destPath = "./test/tmp/build/application.a/dest-dev"; const expectedPath = path.join("test", "expected", "build", "application.a", "dest-dev"); From 8f29205b8c5734cf5c04be64a8c36aea90fb4a54 Mon Sep 17 00:00:00 2001 From: Kristian Kraljic Date: Mon, 16 Dec 2019 15:51:23 +0100 Subject: [PATCH 6/7] Adapt JSDoc for included/excludedDependencies --- lib/builder/builder.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index ef359658b..e5196f31d 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -207,8 +207,8 @@ module.exports = { * @param {string} parameters.destPath Target path * @param {boolean} [parameters.cleanDest=false] Decides whether project should clean the target path before build * @param {boolean} [parameters.buildDependencies=false] Decides whether project dependencies are built as well - * @param {Array} [parameters.includedDependencies=[]] List of build dependencies to be included if buildDependencies is true - * @param {Array} [parameters.excludedDependencies=[]] List of build dependencies to be excluded if buildDependencies is true. If the wildcard '*' is provided, only the included dependencies will be built. + * @param {Array.} [parameters.includedDependencies=[]] List of build dependencies to be included if buildDependencies is true + * @param {Array.} [parameters.excludedDependencies=[]] List of build dependencies to be excluded if buildDependencies is true. If the wildcard '*' is provided, only the included dependencies will be built. * @param {boolean} [parameters.dev=false] Decides whether a development build should be activated (skips non-essential and time-intensive tasks) * @param {boolean} [parameters.selfContained=false] Flag to activate self contained build * @param {boolean} [parameters.jsdoc=false] Flag to activate JSDoc build @@ -263,7 +263,7 @@ module.exports = { const projectCountMarker = {}; function projectCount(project, count = 0) { if (buildDependencies) { - count = (project.dependencies || []).filter(projectFilter).reduce((depCount, depProject) => { + count = project.dependencies.filter(projectFilter).reduce((depCount, depProject) => { return projectCount(depProject, depCount); }, count); } @@ -282,7 +282,7 @@ module.exports = { // Build dependencies in sequence as it is far easier to detect issues and reduces // side effects or other issues such as too many open files if (buildDependencies) { - depPromise = (project.dependencies || []).filter(projectFilter).reduce(function(p, depProject) { + depPromise = project.dependencies.filter(projectFilter).reduce(function(p, depProject) { return p.then(() => buildProject(depProject)); }, Promise.resolve()); } else { From c2742e789d30a4b3a2e45ccced4dd3a8727f51f5 Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Mon, 16 Dec 2019 15:54:25 +0100 Subject: [PATCH 7/7] Test: Fix application.a expected resources --- .../application.a/dest-deps-excl/index.html | 11 ++++++++ .../resources/library/a/.library | 17 +++++++++++ .../library/a/themes/base/library-RTL.css | 3 ++ .../a/themes/base/library-parameters.json | 1 + .../library/a/themes/base/library.css | 3 ++ .../library/a/themes/base/library.source.less | 6 ++++ .../resources/library/b/.library | 17 +++++++++++ .../resources/library/c/.library | 17 +++++++++++ .../application.a/dest-deps-excl/test-dbg.js | 9 ++++++ .../test-resources/LibraryC/Test.html | 0 .../test-resources/library/a/Test.html | 0 .../test-resources/library/b/Test.html | 0 .../application.a/dest-deps-excl/test.js | 1 + .../dest-deps/resources/library/a/.library | 17 +++++++++++ .../library/a/themes/base/library-RTL.css | 3 ++ .../a/themes/base/library-parameters.json | 1 + .../library/a/themes/base/library.css | 3 ++ .../library/a/themes/base/library.source.less | 6 ++++ .../dest-deps/resources/library/b/.library | 17 +++++++++++ .../dest-deps/resources/library/c/.library | 17 +++++++++++ .../resources/library/d/manifest.json | 28 ------------------- .../test-resources/LibraryC/Test.html | 0 .../test-resources/library/a/Test.html | 0 .../test-resources/library/b/Test.html | 0 .../dest-depself/resources/library/a/.library | 17 +++++++++++ .../library/a/themes/base/library-RTL.css | 3 ++ .../a/themes/base/library-parameters.json | 1 + .../library/a/themes/base/library.css | 3 ++ .../library/a/themes/base/library.source.less | 6 ++++ .../dest-depself/resources/library/b/.library | 17 +++++++++++ .../dest-depself/resources/library/c/.library | 17 +++++++++++ .../resources/library/d/manifest.json | 28 ------------------- .../test-resources/LibraryC/Test.html | 0 .../test-resources/library/a/Test.html | 0 .../test-resources/library/b/Test.html | 0 test/lib/builder/builder.js | 17 +++++------ 36 files changed, 222 insertions(+), 64 deletions(-) create mode 100644 test/expected/build/application.a/dest-deps-excl/index.html create mode 100644 test/expected/build/application.a/dest-deps-excl/resources/library/a/.library create mode 100644 test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library-RTL.css create mode 100644 test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library-parameters.json create mode 100644 test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library.css create mode 100644 test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library.source.less create mode 100644 test/expected/build/application.a/dest-deps-excl/resources/library/b/.library create mode 100644 test/expected/build/application.a/dest-deps-excl/resources/library/c/.library create mode 100644 test/expected/build/application.a/dest-deps-excl/test-dbg.js create mode 100644 test/expected/build/application.a/dest-deps-excl/test-resources/LibraryC/Test.html create mode 100644 test/expected/build/application.a/dest-deps-excl/test-resources/library/a/Test.html create mode 100644 test/expected/build/application.a/dest-deps-excl/test-resources/library/b/Test.html create mode 100644 test/expected/build/application.a/dest-deps-excl/test.js create mode 100644 test/expected/build/application.a/dest-deps/resources/library/a/.library create mode 100644 test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library-RTL.css create mode 100644 test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library-parameters.json create mode 100644 test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library.css create mode 100644 test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library.source.less create mode 100644 test/expected/build/application.a/dest-deps/resources/library/b/.library create mode 100644 test/expected/build/application.a/dest-deps/resources/library/c/.library delete mode 100644 test/expected/build/application.a/dest-deps/resources/library/d/manifest.json create mode 100644 test/expected/build/application.a/dest-deps/test-resources/LibraryC/Test.html create mode 100644 test/expected/build/application.a/dest-deps/test-resources/library/a/Test.html create mode 100644 test/expected/build/application.a/dest-deps/test-resources/library/b/Test.html create mode 100644 test/expected/build/application.a/dest-depself/resources/library/a/.library create mode 100644 test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library-RTL.css create mode 100644 test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library-parameters.json create mode 100644 test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library.css create mode 100644 test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library.source.less create mode 100644 test/expected/build/application.a/dest-depself/resources/library/b/.library create mode 100644 test/expected/build/application.a/dest-depself/resources/library/c/.library delete mode 100644 test/expected/build/application.a/dest-depself/resources/library/d/manifest.json create mode 100644 test/expected/build/application.a/dest-depself/test-resources/LibraryC/Test.html create mode 100644 test/expected/build/application.a/dest-depself/test-resources/library/a/Test.html create mode 100644 test/expected/build/application.a/dest-depself/test-resources/library/b/Test.html diff --git a/test/expected/build/application.a/dest-deps-excl/index.html b/test/expected/build/application.a/dest-deps-excl/index.html new file mode 100644 index 000000000..1523b1dc3 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/index.html @@ -0,0 +1,11 @@ + + + + Application A + + + + + + \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-excl/resources/library/a/.library b/test/expected/build/application.a/dest-deps-excl/resources/library/a/.library new file mode 100644 index 000000000..cddfadd9a --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/resources/library/a/.library @@ -0,0 +1,17 @@ + + + + library.a + SAP SE + Some fancy copyright ${currentYear} + 1.0.0 + + Library A + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library-RTL.css b/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library-RTL.css new file mode 100644 index 000000000..5398b3f08 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library-RTL.css @@ -0,0 +1,3 @@ +.library-a-foo{color:#fafad2;padding:1px 4px 3px 2px} +/* Inline theming parameters */ +#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')} diff --git a/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library-parameters.json b/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library-parameters.json new file mode 100644 index 000000000..da3b7a52f --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library-parameters.json @@ -0,0 +1 @@ +{"libraryAColor1":"#fafad2"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library.css b/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library.css new file mode 100644 index 000000000..ba056b3c0 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library.css @@ -0,0 +1,3 @@ +.library-a-foo{color:#fafad2;padding:1px 2px 3px 4px} +/* Inline theming parameters */ +#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')} diff --git a/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library.source.less b/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library.source.less new file mode 100644 index 000000000..ff0f1d5e3 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/resources/library/a/themes/base/library.source.less @@ -0,0 +1,6 @@ +@libraryAColor1: lightgoldenrodyellow; + +.library-a-foo { + color: @libraryAColor1; + padding: 1px 2px 3px 4px; +} diff --git a/test/expected/build/application.a/dest-deps-excl/resources/library/b/.library b/test/expected/build/application.a/dest-deps-excl/resources/library/b/.library new file mode 100644 index 000000000..8cfb124a9 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/resources/library/b/.library @@ -0,0 +1,17 @@ + + + + library.b + SAP SE + Some fancy copyright ${currentYear} + 1.0.0 + + Library B + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-deps-excl/resources/library/c/.library b/test/expected/build/application.a/dest-deps-excl/resources/library/c/.library new file mode 100644 index 000000000..3c011ecd6 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/resources/library/c/.library @@ -0,0 +1,17 @@ + + + + library.c + SAP SE + ${copyright} + 1.0.0 + + Library C + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-deps-excl/test-dbg.js b/test/expected/build/application.a/dest-deps-excl/test-dbg.js new file mode 100644 index 000000000..cb4595405 --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/test-dbg.js @@ -0,0 +1,9 @@ +sap.ui.define([ + "library/d/some" +], function(someObject) { + function test(paramA) { + var variableA = paramA; + console.log(variableA); + } + test(); +}); diff --git a/test/expected/build/application.a/dest-deps-excl/test-resources/LibraryC/Test.html b/test/expected/build/application.a/dest-deps-excl/test-resources/LibraryC/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps-excl/test-resources/library/a/Test.html b/test/expected/build/application.a/dest-deps-excl/test-resources/library/a/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps-excl/test-resources/library/b/Test.html b/test/expected/build/application.a/dest-deps-excl/test-resources/library/b/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps-excl/test.js b/test/expected/build/application.a/dest-deps-excl/test.js new file mode 100644 index 000000000..fd8278c6e --- /dev/null +++ b/test/expected/build/application.a/dest-deps-excl/test.js @@ -0,0 +1 @@ +sap.ui.define(["library/d/some"],function(n){function o(n){var o=n;console.log(o)}o()}); \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/library/a/.library b/test/expected/build/application.a/dest-deps/resources/library/a/.library new file mode 100644 index 000000000..cddfadd9a --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/a/.library @@ -0,0 +1,17 @@ + + + + library.a + SAP SE + Some fancy copyright ${currentYear} + 1.0.0 + + Library A + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library-RTL.css b/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library-RTL.css new file mode 100644 index 000000000..5398b3f08 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library-RTL.css @@ -0,0 +1,3 @@ +.library-a-foo{color:#fafad2;padding:1px 4px 3px 2px} +/* Inline theming parameters */ +#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')} diff --git a/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library-parameters.json b/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library-parameters.json new file mode 100644 index 000000000..da3b7a52f --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library-parameters.json @@ -0,0 +1 @@ +{"libraryAColor1":"#fafad2"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library.css b/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library.css new file mode 100644 index 000000000..ba056b3c0 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library.css @@ -0,0 +1,3 @@ +.library-a-foo{color:#fafad2;padding:1px 2px 3px 4px} +/* Inline theming parameters */ +#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')} diff --git a/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library.source.less b/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library.source.less new file mode 100644 index 000000000..ff0f1d5e3 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/a/themes/base/library.source.less @@ -0,0 +1,6 @@ +@libraryAColor1: lightgoldenrodyellow; + +.library-a-foo { + color: @libraryAColor1; + padding: 1px 2px 3px 4px; +} diff --git a/test/expected/build/application.a/dest-deps/resources/library/b/.library b/test/expected/build/application.a/dest-deps/resources/library/b/.library new file mode 100644 index 000000000..8cfb124a9 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/b/.library @@ -0,0 +1,17 @@ + + + + library.b + SAP SE + Some fancy copyright ${currentYear} + 1.0.0 + + Library B + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-deps/resources/library/c/.library b/test/expected/build/application.a/dest-deps/resources/library/c/.library new file mode 100644 index 000000000..3c011ecd6 --- /dev/null +++ b/test/expected/build/application.a/dest-deps/resources/library/c/.library @@ -0,0 +1,17 @@ + + + + library.c + SAP SE + ${copyright} + 1.0.0 + + Library C + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-deps/resources/library/d/manifest.json b/test/expected/build/application.a/dest-deps/resources/library/d/manifest.json deleted file mode 100644 index 4ad3d1aef..000000000 --- a/test/expected/build/application.a/dest-deps/resources/library/d/manifest.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_version": "1.9.0", - "sap.app": { - "id": "library.d", - "type": "library", - "embeds": [], - "applicationVersion": { - "version": "1.0.0" - }, - "title": "Library D", - "description": "Library D", - "resources": "resources.json", - "offline": true - }, - "sap.ui": { - "technology": "UI5", - "supportedThemes": [] - }, - "sap.ui5": { - "dependencies": { - "minUI5Version": "1.0", - "libs": {} - }, - "library": { - "i18n": false - } - } -} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-deps/test-resources/LibraryC/Test.html b/test/expected/build/application.a/dest-deps/test-resources/LibraryC/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps/test-resources/library/a/Test.html b/test/expected/build/application.a/dest-deps/test-resources/library/a/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-deps/test-resources/library/b/Test.html b/test/expected/build/application.a/dest-deps/test-resources/library/b/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-depself/resources/library/a/.library b/test/expected/build/application.a/dest-depself/resources/library/a/.library new file mode 100644 index 000000000..cddfadd9a --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/a/.library @@ -0,0 +1,17 @@ + + + + library.a + SAP SE + Some fancy copyright ${currentYear} + 1.0.0 + + Library A + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library-RTL.css b/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library-RTL.css new file mode 100644 index 000000000..5398b3f08 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library-RTL.css @@ -0,0 +1,3 @@ +.library-a-foo{color:#fafad2;padding:1px 4px 3px 2px} +/* Inline theming parameters */ +#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')} diff --git a/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library-parameters.json b/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library-parameters.json new file mode 100644 index 000000000..da3b7a52f --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library-parameters.json @@ -0,0 +1 @@ +{"libraryAColor1":"#fafad2"} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library.css b/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library.css new file mode 100644 index 000000000..ba056b3c0 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library.css @@ -0,0 +1,3 @@ +.library-a-foo{color:#fafad2;padding:1px 2px 3px 4px} +/* Inline theming parameters */ +#sap-ui-theme-library\.a{background-image:url('data:text/plain;utf-8,%7B%22libraryAColor1%22%3A%22%23fafad2%22%7D')} diff --git a/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library.source.less b/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library.source.less new file mode 100644 index 000000000..ff0f1d5e3 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/a/themes/base/library.source.less @@ -0,0 +1,6 @@ +@libraryAColor1: lightgoldenrodyellow; + +.library-a-foo { + color: @libraryAColor1; + padding: 1px 2px 3px 4px; +} diff --git a/test/expected/build/application.a/dest-depself/resources/library/b/.library b/test/expected/build/application.a/dest-depself/resources/library/b/.library new file mode 100644 index 000000000..8cfb124a9 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/b/.library @@ -0,0 +1,17 @@ + + + + library.b + SAP SE + Some fancy copyright ${currentYear} + 1.0.0 + + Library B + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-depself/resources/library/c/.library b/test/expected/build/application.a/dest-depself/resources/library/c/.library new file mode 100644 index 000000000..3c011ecd6 --- /dev/null +++ b/test/expected/build/application.a/dest-depself/resources/library/c/.library @@ -0,0 +1,17 @@ + + + + library.c + SAP SE + ${copyright} + 1.0.0 + + Library C + + + + library.d + + + + diff --git a/test/expected/build/application.a/dest-depself/resources/library/d/manifest.json b/test/expected/build/application.a/dest-depself/resources/library/d/manifest.json deleted file mode 100644 index 4ad3d1aef..000000000 --- a/test/expected/build/application.a/dest-depself/resources/library/d/manifest.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "_version": "1.9.0", - "sap.app": { - "id": "library.d", - "type": "library", - "embeds": [], - "applicationVersion": { - "version": "1.0.0" - }, - "title": "Library D", - "description": "Library D", - "resources": "resources.json", - "offline": true - }, - "sap.ui": { - "technology": "UI5", - "supportedThemes": [] - }, - "sap.ui5": { - "dependencies": { - "minUI5Version": "1.0", - "libs": {} - }, - "library": { - "i18n": false - } - } -} \ No newline at end of file diff --git a/test/expected/build/application.a/dest-depself/test-resources/LibraryC/Test.html b/test/expected/build/application.a/dest-depself/test-resources/LibraryC/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-depself/test-resources/library/a/Test.html b/test/expected/build/application.a/dest-depself/test-resources/library/a/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/expected/build/application.a/dest-depself/test-resources/library/b/Test.html b/test/expected/build/application.a/dest-depself/test-resources/library/b/Test.html new file mode 100644 index 000000000..e69de29bb diff --git a/test/lib/builder/builder.js b/test/lib/builder/builder.js index 55f9754a6..8b1bcf5d4 100644 --- a/test/lib/builder/builder.js +++ b/test/lib/builder/builder.js @@ -16,6 +16,7 @@ const applicationGPath = path.join(__dirname, "..", "..", "fixtures", "applicati const applicationHPath = path.join(__dirname, "..", "..", "fixtures", "application.h"); const applicationIPath = path.join(__dirname, "..", "..", "fixtures", "application.i"); const applicationJPath = path.join(__dirname, "..", "..", "fixtures", "application.j"); +const collectionPath = path.join(__dirname, "..", "..", "fixtures", "collection"); const libraryDPath = path.join(__dirname, "..", "..", "fixtures", "library.d"); const libraryEPath = path.join(__dirname, "..", "..", "fixtures", "library.e"); const libraryHPath = path.join(__dirname, "..", "..", "fixtures", "library.h"); @@ -115,7 +116,7 @@ test("Build application.a with dependencies", (t) => { return builder.build({ tree: applicationATree, destPath, - excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"], + excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters", "generateLibraryManifest"], buildDependencies: true }).then(() => { return findFiles(expectedPath); @@ -136,7 +137,7 @@ test("Build application.a with dependencies include", (t) => { return builder.build({ tree: applicationATree, destPath, - excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"], + excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters", "generateLibraryManifest"], buildDependencies: true, includedDependencies: ["*"] }).then(() => { return findFiles(expectedPath); @@ -152,12 +153,12 @@ test("Build application.a with dependencies include", (t) => { test("Build application.a with dependencies exclude", (t) => { const destPath = "./test/tmp/build/application.a/dest-deps-excl"; - const expectedPath = path.join("test", "expected", "build", "application.a", "dest"); + const expectedPath = path.join("test", "expected", "build", "application.a", "dest-deps-excl"); return builder.build({ tree: applicationATree, destPath, - excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters"], + excludedTasks: ["generateComponentPreload", "generateStandaloneAppBundle", "generateVersionInfo", "generateLibraryPreload", "escapeNonAsciiCharacters", "generateLibraryManifest"], buildDependencies: true, excludedDependencies: ["library.d"] }).then(() => { return findFiles(expectedPath); @@ -199,7 +200,7 @@ test("Build application.a with dependencies self-contained", (t) => { return builder.build({ tree: applicationATree, destPath, - excludedTasks: ["generateComponentPreload", "generateVersionInfo", "escapeNonAsciiCharacters"], + excludedTasks: ["generateComponentPreload", "generateVersionInfo", "escapeNonAsciiCharacters", "generateLibraryManifest"], buildDependencies: true, selfContained: true }).then(() => { @@ -630,7 +631,7 @@ const applicationATree = { { "id": "library.a", "version": "1.0.0", - "path": path.join(applicationAPath, "node_modules", "collection", "library.a"), + "path": path.join(collectionPath, "library.a"), "dependencies": [], "_level": 1, "specVersion": "0.1", @@ -656,7 +657,7 @@ const applicationATree = { { "id": "library.b", "version": "1.0.0", - "path": path.join(applicationAPath, "node_modules", "collection", "library.b"), + "path": path.join(collectionPath, "library.b"), "dependencies": [], "_level": 1, "specVersion": "0.1", @@ -682,7 +683,7 @@ const applicationATree = { { "id": "library.c", "version": "1.0.0", - "path": path.join(applicationAPath, "node_modules", "collection", "library.c"), + "path": path.join(collectionPath, "library.c"), "dependencies": [], "_level": 1, "specVersion": "0.1",