Skip to content

Commit

Permalink
[INTERNAL] Projects: Pass builder resource excludes to adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte committed Jun 8, 2022
1 parent 0ac1569 commit 84abeb6
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
1 change: 0 additions & 1 deletion lib/buildDefinitions/AbstractBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class AbstractBuilder {
this.tasks = {};
this.taskExecutionOrder = [];


this.addStandardTasks({
project,
taskUtil,
Expand Down
1 change: 1 addition & 0 deletions lib/specifications/ComponentProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion lib/specifications/Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Project extends Specification {
return this._config.customConfiguration;
}

getBuilderResourceExcludes() {
getBuilderResourcesExcludes() {
return this._config.builder?.resources?.excludes || [];
}

Expand Down
3 changes: 2 additions & 1 deletion lib/specifications/types/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
});
}

Expand Down
9 changes: 6 additions & 3 deletions lib/specifications/types/LegacyLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
});
}

Expand All @@ -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()
});
}

Expand All @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions lib/specifications/types/Library.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
});
}

Expand All @@ -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;
}
Expand Down
6 changes: 4 additions & 2 deletions lib/specifications/types/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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()
}];
}
}
Expand Down
6 changes: 4 additions & 2 deletions lib/specifications/types/ThemeLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`,
Expand Down

0 comments on commit 84abeb6

Please sign in to comment.