Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Builder: Handle files without extension #637

Merged
merged 3 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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