Skip to content

Commit

Permalink
[FIX] Builder: Handle files without extension (#637)
Browse files Browse the repository at this point in the history
Fixes: SAP/ui5-tooling#546

Co-authored-by: Matthias Osswald <mat.osswald@sap.com>
  • Loading branch information
kristian and matz3 authored Aug 25, 2021
1 parent c05587a commit 07aaa24
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ module.exports = {
log.verbose("Finished building project %s. Writing out files...", project.metadata.name);
buildLogger.completeWork(1);

return workspace.byGlob("/**/*.*").then((resources) => {
return workspace.byGlob("/**/*").then((resources) => {
const tagCollection = projectContext.getResourceTagCollection();
return Promise.all(resources.map((resource) => {
if (tagCollection.getTag(resource, projectContext.STANDARD_TAGS.OmitFromBuildResult)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/generateResourcesJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function getCreatorOptions(projectName) {
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
*/
module.exports = async function({workspace, dependencies, options: {projectName}}) {
const resources = await workspace.byGlob(["/resources/**/*.*"].concat(DEFAULT_EXCLUDES));
const resources = await workspace.byGlob(["/resources/**/*"].concat(DEFAULT_EXCLUDES));

// TODO 3.0: Make dependencies parameter mandatory
let dependencyResources;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,18 @@
"name": "changes/id_456_addField.change",
"size": 430
},
{
"name": "fileWithoutExtension",
"size": 27
},
{
"name": "manifest.json",
"module": "application/j/manifest.json",
"size": 423
},
{
"name": "resources.json",
"size": 2040
"size": 2098
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
1 change: 1 addition & 0 deletions test/fixtures/application.a/webapp/fileWithoutExtension
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
1 change: 1 addition & 0 deletions test/fixtures/application.j/webapp/fileWithoutExtension
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A file without an extension
4 changes: 2 additions & 2 deletions test/lib/builder/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ test.serial("Build", async (t) => {
t.true(appBuildParams.taskUtil instanceof DummyTaskUtil, "Correct taskUtil instance provided to type");

t.is(getResourceTagCollectionStub.callCount, 1, "getResourceTagCollection called once");
t.is(getTagStub.callCount, 2, "getTag called once");
t.is(getTagStub.callCount, 3, "getTag called three times");
t.deepEqual(getTagStub.getCall(0).args[1], "👻", "First getTag call with expected tag name");
t.deepEqual(getTagStub.getCall(1).args[1], "👻", "Second getTag call with expected tag name");
t.is(isRootProjectStub.callCount, 2, "isRootProject called once");
t.is(isRootProjectStub.callCount, 3, "isRootProject called three times");
t.is(executeCleanupTasksStub.callCount, 1, "Cleanup called once");
});

Expand Down

0 comments on commit 07aaa24

Please sign in to comment.