Skip to content

Merge LiveSync fixes from release branch #2553

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

Merged
merged 4 commits into from
Feb 16, 2017
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/common
3 changes: 2 additions & 1 deletion lib/services/livesync/platform-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import syncBatchLib = require("../../common/services/livesync/sync-batch");
import * as path from "path";
import * as minimatch from "minimatch";
import * as util from "util";
import * as helpers from "../../common/helpers";

const livesyncInfoFileName = ".nslivesyncinfo";

Expand Down Expand Up @@ -223,7 +224,7 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe

private async getLiveSyncInfoFilePath(deviceAppData: Mobile.IDeviceAppData): Promise<string> {
let deviceRootPath = path.dirname(await deviceAppData.getDeviceProjectRootPath());
let deviceFilePath = path.join(deviceRootPath, livesyncInfoFileName);
let deviceFilePath = helpers.fromWindowsRelativePathToUnix(path.join(deviceRootPath, livesyncInfoFileName));
return deviceFilePath;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export class PlatformService implements IPlatformService {
private async getDeviceBuildInfoFilePath(device: Mobile.IDevice): Promise<string> {
let deviceAppData = this.$deviceAppDataFactory.create(this.$projectData.projectId, device.deviceInfo.platform, device);
let deviceRootPath = path.dirname(await deviceAppData.getDeviceProjectRootPath());
return path.join(deviceRootPath, buildInfoFileName);
return helpers.fromWindowsRelativePathToUnix(path.join(deviceRootPath, buildInfoFileName));
}

private async getDeviceBuildInfo(device: Mobile.IDevice): Promise<IBuildInfo> {
Expand Down
10 changes: 6 additions & 4 deletions lib/services/project-changes-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class ProjectChangesService implements IProjectChangesService {
private _prepareInfo: IPrepareInfo;
private _newFiles: number = 0;
private _outputProjectMtime: number;
private _outputProjectCTime: number;

constructor(
private $platformsData: IPlatformsData,
Expand Down Expand Up @@ -140,6 +141,7 @@ export class ProjectChangesService implements IProjectChangesService {
let platformData = this.$platformsData.getPlatformData(platform);
let prepareInfoFile = path.join(platformData.projectRoot, prepareInfoFileName);
this._outputProjectMtime = this.$fs.getFsStats(prepareInfoFile).mtime.getTime();
this._outputProjectCTime = this.$fs.getFsStats(prepareInfoFile).ctime.getTime();
return false;
}
this._prepareInfo = {
Expand All @@ -150,6 +152,7 @@ export class ProjectChangesService implements IProjectChangesService {
changesRequireBuildTime: null
};
this._outputProjectMtime = 0;
this._outputProjectCTime = 0;
this._changesInfo.appFilesChanged = true;
this._changesInfo.appResourcesChanged = true;
this._changesInfo.modulesChanged = true;
Expand All @@ -161,7 +164,7 @@ export class ProjectChangesService implements IProjectChangesService {
for (let file of files) {
if (this.$fs.exists(file)) {
let fileStats = this.$fs.getFsStats(file);
if (fileStats.mtime.getTime() > this._outputProjectMtime) {
if (fileStats.mtime.getTime() >= this._outputProjectMtime || fileStats.ctime.getTime() >= this._outputProjectCTime) {
return true;
}
}
Expand All @@ -179,11 +182,10 @@ export class ProjectChangesService implements IProjectChangesService {

let fileStats = this.$fs.getFsStats(filePath);

let changed = fileStats.mtime.getTime() > this._outputProjectMtime || fileStats.ctime.getTime() > this._outputProjectMtime;

let changed = fileStats.mtime.getTime() >= this._outputProjectMtime || fileStats.ctime.getTime() >= this._outputProjectCTime;
if (!changed) {
let lFileStats = this.$fs.getLsStats(filePath);
changed = lFileStats.mtime.getTime() > this._outputProjectMtime || lFileStats.ctime.getTime() > this._outputProjectMtime;
changed = lFileStats.mtime.getTime() >= this._outputProjectMtime || lFileStats.ctime.getTime() >= this._outputProjectCTime;
}

if (changed) {
Expand Down