Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Filter configuration specific files #986

Merged
merged 1 commit into from
Jul 27, 2017
Merged

Conversation

nadyaA
Copy link
Contributor

@nadyaA nadyaA commented Jul 6, 2017

Respect prepare/build configuration when preparing project files.

NativeScript/nativescript-cli#2934

@justcodebuilduser
Copy link

💔

@nadyaA nadyaA force-pushed the natanasova/debug-release-bug branch from c42945d to 6236208 Compare July 6, 2017 15:33
@justcodebuilduser
Copy link

💔

@justcodebuilduser
Copy link

💔

let directoryPath = temp.mkdirSync("Project Files Manager Tests");

_.each(filesToCreate, file => fs.writeFile(path.join(directoryPath, file), ""));
_.each(filesToCreate, file => createFile(testInjector, file, "", directoryPath));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createFile returns promise, currently noone is awaiting this promise

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the method to return string. Thanks

return directoryPath;
}

async function createFile(testInjector: IInjector, fileToCreate: string, fileContent: string, directoryPath?: string): Promise<string> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method does not have to be async - it doesn't have any async operations in it

@@ -867,7 +867,7 @@ interface ILiveSyncServiceBase {
* If watch option is not specified executes full sync
* If watch option is specified executes partial sync
*/
sync(data: ILiveSyncData[], projectId: string, filePaths?: string[]): Promise<void>;
sync(data: ILiveSyncData[], projectId: string, filePaths: string[], projectFilesConfig: IProjectFilesConfig): Promise<void>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this changed? The sync method must have filePaths as optional argument, as they are passed only when we are not in full sync mode

@nadyaA nadyaA force-pushed the natanasova/debug-release-bug branch from 1868238 to a42b05a Compare July 11, 2017 11:51
@justcodebuilduser
Copy link

💔

@nadyaA nadyaA force-pushed the natanasova/debug-release-bug branch from a42b05a to 0667a3a Compare July 11, 2017 11:58
@justcodebuilduser
Copy link

💔

@nadyaA nadyaA force-pushed the natanasova/debug-release-bug branch from 0667a3a to f15dba7 Compare July 11, 2017 13:36
@justcodebuilduser
Copy link

💔

@nadyaA
Copy link
Contributor Author

nadyaA commented Jul 11, 2017

run ci

@justcodebuilduser
Copy link

💔

@nadyaA nadyaA force-pushed the natanasova/debug-release-bug branch from f15dba7 to 661ffff Compare July 11, 2017 14:27
@justcodebuilduser
Copy link

💔

helpers.ts Outdated
@@ -400,6 +401,13 @@ export async function connectEventuallyUntilTimeout(factory: () => net.Socket, t
});
}

export function getProjectFilesConfig(release: boolean): IProjectFilesConfig {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;( passing boolean property to a method 😿 😢

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can modify this to be:

export function getProjectFilesConfig(opts: { isReleaseBuild: boolean }): IProjectFilesConfig {
}

@@ -191,11 +199,39 @@ describe("Project Files Manager Tests", () => {
assert.isTrue(fs.exists(path.join(directoryPath, "a.test")));
});

it("filters release specific files", async () => {
const directoryPath = await createFile(testInjector, "test.debug.x", "debug");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since createFile is no longer async you can remove await

it("filters release specific files", async () => {
const directoryPath = await createFile(testInjector, "test.debug.x", "debug");
const releaseFileContent = "release";
await createFile(testInjector, "test.release.x", releaseFileContent, directoryPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

});

it("filters debug specific files by default", async () => {
const directoryPath = await createFile(testInjector, "test.release.x", "release");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await

it("filters debug specific files by default", async () => {
const directoryPath = await createFile(testInjector, "test.release.x", "release");
const debugFileContent = "debug";
await createFile(testInjector, "test.debug.x", debugFileContent, directoryPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await

@nadyaA nadyaA force-pushed the natanasova/debug-release-bug branch from 661ffff to 25c8cda Compare July 26, 2017 13:01
@justcodebuilduser
Copy link

💔

@nadyaA nadyaA force-pushed the natanasova/debug-release-bug branch from 25c8cda to 456b532 Compare July 26, 2017 13:07
@justcodebuilduser
Copy link

💔

Respect prepare/build configuration when preparing project files.
@nadyaA nadyaA force-pushed the natanasova/debug-release-bug branch from 456b532 to 415631c Compare July 27, 2017 13:00
@nadyaA nadyaA merged commit fa89ea0 into master Jul 27, 2017
@nadyaA nadyaA deleted the natanasova/debug-release-bug branch July 27, 2017 13:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants