From 84abeb6fc875a2349ea4cc018ee6c8b9abb353fb Mon Sep 17 00:00:00 2001 From: Merlin Beutlberger Date: Wed, 8 Jun 2022 15:34:03 +0200 Subject: [PATCH] [INTERNAL] Projects: Pass builder resource excludes to adapters --- lib/buildDefinitions/AbstractBuilder.js | 1 - lib/specifications/ComponentProject.js | 1 + lib/specifications/Project.js | 2 +- lib/specifications/types/Application.js | 3 ++- lib/specifications/types/LegacyLibrary.js | 9 ++++++--- lib/specifications/types/Library.js | 6 ++++-- lib/specifications/types/Module.js | 6 ++++-- lib/specifications/types/ThemeLibrary.js | 6 ++++-- 8 files changed, 22 insertions(+), 12 deletions(-) diff --git a/lib/buildDefinitions/AbstractBuilder.js b/lib/buildDefinitions/AbstractBuilder.js index c11ec1841..a339b296a 100644 --- a/lib/buildDefinitions/AbstractBuilder.js +++ b/lib/buildDefinitions/AbstractBuilder.js @@ -40,7 +40,6 @@ class AbstractBuilder { this.tasks = {}; this.taskExecutionOrder = []; - this.addStandardTasks({ project, taskUtil, diff --git a/lib/specifications/ComponentProject.js b/lib/specifications/ComponentProject.js index 2fad4065d..dc7bd7284 100644 --- a/lib/specifications/ComponentProject.js +++ b/lib/specifications/ComponentProject.js @@ -113,6 +113,7 @@ class ComponentProject extends Project { reader = this._getReader(); break; case "runtime": + // Use buildtime reader and link it to / // No test-resources for runtime resource access, // unless runtime is namespaced reader = this.getReader().link({ diff --git a/lib/specifications/Project.js b/lib/specifications/Project.js index c3b2a44df..1e65039d5 100644 --- a/lib/specifications/Project.js +++ b/lib/specifications/Project.js @@ -55,7 +55,7 @@ class Project extends Specification { return this._config.customConfiguration; } - getBuilderResourceExcludes() { + getBuilderResourcesExcludes() { return this._config.builder?.resources?.excludes || []; } diff --git a/lib/specifications/types/Application.js b/lib/specifications/types/Application.js index d11509704..9964f20aa 100644 --- a/lib/specifications/types/Application.js +++ b/lib/specifications/types/Application.js @@ -38,7 +38,8 @@ class Application extends ComponentProject { fsBasePath: fsPath.join(this.getPath(), this._webappPath), virBasePath, name: `Source reader for application project ${this.getName()}`, - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }); } diff --git a/lib/specifications/types/LegacyLibrary.js b/lib/specifications/types/LegacyLibrary.js index 7f34e84d9..c0b0da375 100644 --- a/lib/specifications/types/LegacyLibrary.js +++ b/lib/specifications/types/LegacyLibrary.js @@ -26,7 +26,8 @@ class LegacyLibrary extends Library { fsBasePath: fsPath.join(this.getPath(), this._srcPath), virBasePath: "/", name: `Source reader for library project ${this.getName()}`, - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }); } @@ -35,7 +36,8 @@ class LegacyLibrary extends Library { fsBasePath: fsPath.join(this.getPath(), this._srcPath), virBasePath: this._stripNamespace(virBasePath), name: `Source reader for library project ${this.getName()}`, - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }); } @@ -47,7 +49,8 @@ class LegacyLibrary extends Library { fsBasePath: fsPath.join(this.getPath(), this._testPath), virBasePath: this._stripNamespace(virBasePath), name: `Runtime test-resources reader for library project ${this.getName()}`, - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }); return testReader; } diff --git a/lib/specifications/types/Library.js b/lib/specifications/types/Library.js index 53c72d013..34dad41e9 100644 --- a/lib/specifications/types/Library.js +++ b/lib/specifications/types/Library.js @@ -41,7 +41,8 @@ class Library extends ComponentProject { fsBasePath, virBasePath, name: `Source reader for library project ${this.getName()}`, - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }); } @@ -57,7 +58,8 @@ class Library extends ComponentProject { fsBasePath, virBasePath, name: `Runtime test-resources reader for library project ${this.getName()}`, - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }); return testReader; } diff --git a/lib/specifications/types/Module.js b/lib/specifications/types/Module.js index 0cc2e5b60..6b6ba787e 100644 --- a/lib/specifications/types/Module.js +++ b/lib/specifications/types/Module.js @@ -88,7 +88,8 @@ class Module extends Project { name: `'${relFsPath}'' reader for module project ${this.getName()}`, virBasePath, fsBasePath: fsPath.join(this.getPath(), relFsPath), - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }; })); } else { @@ -101,7 +102,8 @@ class Module extends Project { name: `Root reader for module project ${this.getName()}`, virBasePath: "/", fsBasePath: this.getPath(), - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }]; } } diff --git a/lib/specifications/types/ThemeLibrary.js b/lib/specifications/types/ThemeLibrary.js index 54154ec1d..cd817947b 100644 --- a/lib/specifications/types/ThemeLibrary.js +++ b/lib/specifications/types/ThemeLibrary.js @@ -35,14 +35,16 @@ class ThemeLibrary extends Project { fsBasePath: fsPath.join(this.getPath(), this._srcPath), virBasePath: "/resources/", name: `Runtime resources reader for theme-library project ${this.getName()}`, - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }); if (this._testPathExists) { const testReader = resourceFactory.createReader({ fsBasePath: fsPath.join(this.getPath(), this._testPath), virBasePath: "/test-resources/", name: `Runtime test-resources reader for theme-library project ${this.getName()}`, - project: this + project: this, + excludes: this.getBuilderResourcesExcludes() }); reader = resourceFactory.createReaderCollection({ name: `Reader collection for theme-library project ${this.getName()}`,