diff --git a/lib/processors/resourceListCreator.js b/lib/processors/resourceListCreator.js index 653a2a845..1f46b713d 100644 --- a/lib/processors/resourceListCreator.js +++ b/lib/processors/resourceListCreator.js @@ -146,10 +146,6 @@ class ResourceInfo { } return result; } - - isEmpty() { - return this.i18nLocale == null && this.i18nName == null && this.isDebug == false && this.theme == null && this.merged == false; - } } /** @@ -412,7 +408,7 @@ class ResourceCollector { resourceInfo.condRequired = resourceInfo.condRequired || new Set(); info.dependencies.forEach((dep) => { if ( info.isConditionalDependency(dep) ) { - resourceInfo.condRequired.push(dep); + resourceInfo.condRequired.add(dep); } else if ( !info.isImplicitDependency(dep) ) { resourceInfo.required.add(dep); } diff --git a/lib/types/library/LibraryBuilder.js b/lib/types/library/LibraryBuilder.js index 2f037e0fd..0e0eb3849 100644 --- a/lib/types/library/LibraryBuilder.js +++ b/lib/types/library/LibraryBuilder.js @@ -1,22 +1,5 @@ const AbstractBuilder = require("../AbstractBuilder"); -const tasks = { // can't require index.js due to circular dependency - generateComponentPreload: require("../../tasks/bundlers/generateComponentPreload"), - generateFlexChangesBundle: require("../../tasks/bundlers/generateFlexChangesBundle"), - generateBundle: require("../../tasks/bundlers/generateBundle"), - generateLibraryPreload: require("../../tasks/bundlers/generateLibraryPreload"), - generateManifestBundle: require("../../tasks/bundlers/generateManifestBundle"), - generateStandaloneAppBundle: require("../../tasks/bundlers/generateStandaloneAppBundle"), - escapeNonAsciiCharacters: require("../../tasks/escapeNonAsciiCharacters"), - buildThemes: require("../../tasks/buildThemes"), - createDebugFiles: require("../../tasks/createDebugFiles"), - generateJsdoc: require("../../tasks/jsdoc/generateJsdoc"), - executeJsdocSdkTransformation: require("../../tasks/jsdoc/executeJsdocSdkTransformation"), - generateLibraryManifest: require("../../tasks/generateLibraryManifest"), - generateVersionInfo: require("../../tasks/generateVersionInfo"), - replaceCopyright: require("../../tasks/replaceCopyright"), - replaceVersion: require("../../tasks/replaceVersion"), - uglify: require("../../tasks/uglify") -}; +const {getTask} = require("../../tasks/taskRepository"); class LibraryBuilder extends AbstractBuilder { addStandardTasks({resourceCollections, project, log, buildContext}) { @@ -194,6 +177,15 @@ class LibraryBuilder extends AbstractBuilder { } }); }); + + this.addTask("generateResourcesJson", () => { + return getTask("generateResourcesJson").task({ + workspace: resourceCollections.workspace, + dependencies: resourceCollections.dependencies, + options: { + } + }); + }); } } diff --git a/test/expected/build/library.n/dest/resources/library/n/Button-dbg.js b/test/expected/build/library.n/dest/resources/library/n/Button-dbg.js index ca43eff95..274df4a28 100644 --- a/test/expected/build/library.n/dest/resources/library/n/Button-dbg.js +++ b/test/expected/build/library.n/dest/resources/library/n/Button-dbg.js @@ -14,7 +14,7 @@ sap.ui.define([ ) { "use strict"; - return Control.extend("library.n.Button", { + return Control.extend("library.n.Button", { metadata : { library : "library.n", properties : { @@ -44,6 +44,13 @@ sap.ui.define([ oRm.close("span"); oRm.close("button"); } + }, + helper: function(sCalendarType) { + var sCalendar = "sap/ui/core/date/" + sCalendarType; + sap.ui.require(["sap/ui/core/format/DateFormat", sCalendar], function(DateFormat, Calendar) { + DateFormat.getInstance(); + new Calendar(); + }); } }); diff --git a/test/expected/build/library.n/dest/resources/library/n/Button.js b/test/expected/build/library.n/dest/resources/library/n/Button.js index 9b2547fdf..58360358b 100644 --- a/test/expected/build/library.n/dest/resources/library/n/Button.js +++ b/test/expected/build/library.n/dest/resources/library/n/Button.js @@ -3,4 +3,4 @@ * (c) Copyright 2009-xxx SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ -sap.ui.define(["./library","sap/ui/core/Control"],function(e,t){"use strict";return t.extend("library.n.Button",{metadata:{library:"library.n",properties:{text:{type:"string",group:"Misc",defaultValue:""}},aggregations:{icon:{type:"sap.ui.core.Control",cardinality:"0..1"}},events:{press:{}}},designtime:"library/n/designtime/Button.designtime",renderer:{apiVersion:2,render:function(e,t){e.openStart("button",t);e.class("libNBtnBase");e.openEnd();if(t.getIcon()){e.renderControl(t.getIcon())}e.openStart("span",t.getId()+"-content");e.class("libNBtnContent");e.openEnd();e.text(sText);e.close("span");e.close("button")}}})}); \ No newline at end of file +sap.ui.define(["./library","sap/ui/core/Control"],function(e,t){"use strict";return t.extend("library.n.Button",{metadata:{library:"library.n",properties:{text:{type:"string",group:"Misc",defaultValue:""}},aggregations:{icon:{type:"sap.ui.core.Control",cardinality:"0..1"}},events:{press:{}}},designtime:"library/n/designtime/Button.designtime",renderer:{apiVersion:2,render:function(e,t){e.openStart("button",t);e.class("libNBtnBase");e.openEnd();if(t.getIcon()){e.renderControl(t.getIcon())}e.openStart("span",t.getId()+"-content");e.class("libNBtnContent");e.openEnd();e.text(sText);e.close("span");e.close("button")}},helper:function(e){var t="sap/ui/core/date/"+e;sap.ui.require(["sap/ui/core/format/DateFormat",t],function(e,t){e.getInstance();new t})}})}); \ No newline at end of file diff --git a/test/expected/build/library.n/dest/resources/library/n/resources.json b/test/expected/build/library.n/dest/resources/library/n/resources.json index da7f5a806..659f88e8f 100644 --- a/test/expected/build/library.n/dest/resources/library/n/resources.json +++ b/test/expected/build/library.n/dest/resources/library/n/resources.json @@ -11,7 +11,11 @@ "required": [ "library/n/library.js", "sap/ui/core/Control.js" - ] + ], + "condRequired": [ + "sap/ui/core/format/DateFormat.js" + ], + "dynRequired": true }, { "name": "Button.js", @@ -19,7 +23,11 @@ "required": [ "library/n/library.js", "sap/ui/core/Control.js" - ] + ], + "condRequired": [ + "sap/ui/core/format/DateFormat.js" + ], + "dynRequired": true }, { "name": "changeHandler/SplitButton-dbg.js", diff --git a/test/fixtures/library.n/src/library/n/Button.js b/test/fixtures/library.n/src/library/n/Button.js index 7259cde38..70f7b4918 100644 --- a/test/fixtures/library.n/src/library/n/Button.js +++ b/test/fixtures/library.n/src/library/n/Button.js @@ -12,7 +12,7 @@ sap.ui.define([ ) { "use strict"; - return Control.extend("library.n.Button", { + return Control.extend("library.n.Button", { metadata : { library : "library.n", properties : { @@ -42,6 +42,13 @@ sap.ui.define([ oRm.close("span"); oRm.close("button"); } + }, + helper: function(sCalendarType) { + var sCalendar = "sap/ui/core/date/" + sCalendarType; + sap.ui.require(["sap/ui/core/format/DateFormat", sCalendar], function(DateFormat, Calendar) { + DateFormat.getInstance(); + new Calendar(); + }); } });