Skip to content

Commit

Permalink
[FEATURE] Builder: Add excludes option (#254)
Browse files Browse the repository at this point in the history
* Builder: Provide getProjectExcludes callback to resourceFactory
* Adapt tests to new behavior of FileSystem._runGlob which now throws for GLOB errors
* Add builder integration test for file exclude patterns
* Use new resourceFactory API parameter "getVirtualBasePathPrefix"
    * Instead of deprecated useNamespace flag. Also see 
      SAP/ui5-fs@56b85e9
* Update globby dependency
* Bump @ui5/fs from 1.0.2 to 1.1.0 (Changelog of this version: 
  https://github.com/SAP/ui5-fs/blob/v1.1.0/CHANGELOG.md)
  • Loading branch information
romaniam authored and RandomByte committed Jun 3, 2019
1 parent c01d4ed commit 6a7883e
Show file tree
Hide file tree
Showing 8 changed files with 310 additions and 59 deletions.
13 changes: 11 additions & 2 deletions lib/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,17 @@ module.exports = {

const projectType = typeRepository.getType(project.type);
const resourceCollections = resourceFactory.createCollectionsForTree(project, {
useNamespaces: true,
virtualReaders: projectWriters
virtualReaders: projectWriters,
getVirtualBasePathPrefix: function({project, virBasePath}) {
if (project.type === "application" && project.metadata.namespace) {
return "/resources/" + project.metadata.namespace;
}
},
getProjectExcludes: function(project) {
if (project.builder && project.builder.resources) {
return project.builder.resources.excludes;
}
}
});

const writer = new MemAdapter({
Expand Down
239 changes: 200 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@
"url": "[email protected]:SAP/ui5-builder.git"
},
"dependencies": {
"@ui5/fs": "^1.0.2",
"@ui5/fs": "^1.1.0",
"@ui5/logger": "^1.0.1",
"cheerio": "^0.22.0",
"escodegen": "^1.11.1",
"escope": "^3.6.0",
"esprima": "^4.0.1",
"estraverse": "^4.2.0",
"globby": "^7.1.1",
"globby": "^9.2.0",
"graceful-fs": "^4.1.15",
"jsdoc": "3.5.5",
"less-openui5": "^0.6.0",
Expand Down
14 changes: 14 additions & 0 deletions test/expected/build/application.g/excludes/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"_version": "1.1.0",
"sap.app": {
"_version": "1.1.0",
"id": "application.g",
"type": "application",
"applicationVersion": {
"version": "${version}"
},
"embeds": ["embedded"],
"title": "{{title}}"
},
"customCopyrightString": "${copyright}"
}
Loading

0 comments on commit 6a7883e

Please sign in to comment.