Skip to content

Fixed: the app is recompiled always when first time livesync #1879

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 3 commits into from
Jun 27, 2016
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
7 changes: 5 additions & 2 deletions lib/services/livesync/android-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ class AndroidLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase<
}).future<void>()();
}

public afterInstallApplicationAction(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
return this.deviceHashService.uploadHashFileToDevice(localToDevicePaths);
public afterInstallApplicationAction(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<boolean> {
return (() => {
this.deviceHashService.uploadHashFileToDevice(localToDevicePaths).wait();
return false;
}).future<boolean>()();
}

private getDeviceRootPath(appIdentifier: string): string {
Expand Down
6 changes: 6 additions & 0 deletions lib/services/livesync/ios-livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase<Mobi
super(_device, $liveSyncProvider);
}

public afterInstallApplicationAction(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<boolean> {
return (() => {
return this.$options.watch;
}).future<boolean>()();
}

public removeFiles(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
return (() => {
_.each(localToDevicePaths, localToDevicePathData => this.device.fileSystem.deleteFile(localToDevicePathData.getDevicePath(), appIdentifier));
Expand Down
9 changes: 7 additions & 2 deletions lib/services/livesync/livesync-service-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ export abstract class LiveSyncServiceBase<T extends Mobile.IDevice> {
private $liveSyncProvider: ILiveSyncProvider) { }

public refreshApplication(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], forceExecuteFullSync: boolean): IFuture<void> {
let canExecuteFastSync = !forceExecuteFullSync && localToDevicePaths &&
_.each(localToDevicePaths, localToDevicePath => this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), deviceAppData.platform));
let canExecuteFastSync = !forceExecuteFullSync && localToDevicePaths !== undefined;
for (let localToDevicePath of localToDevicePaths) {
if (!this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), deviceAppData.platform)) {
canExecuteFastSync = false;
break;
}
}
if (canExecuteFastSync) {
return this.reloadPage(deviceAppData);
}
Expand Down