Skip to content

Commit 8b52b77

Browse files
committed
Execute batch sync when you live sync application with the --watch option
Remove the data.canExecuteFastSync. The check is made in the respective {N} service instead of in the base implementation
1 parent fddabef commit 8b52b77

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

lib/services/livesync/android-livesync-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ class AndroidLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase<
1414
private $mobileHelper: Mobile.IMobileHelper,
1515
private $options: IOptions,
1616
private $injector: IInjector,
17-
private $projectData: IProjectData) {
18-
super(_device);
17+
private $projectData: IProjectData,
18+
$liveSyncProvider: ILiveSyncProvider) {
19+
super(_device, $liveSyncProvider);
1920
}
2021

2122
public restartApplication(deviceAppData: Mobile.IDeviceAppData): IFuture<void> {

lib/services/livesync/ios-livesync-service.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ class IOSLiveSyncService extends liveSyncServiceBaseLib.LiveSyncServiceBase<Mobi
1414
private $iOSEmulatorServices: Mobile.IiOSSimulatorService,
1515
private $injector: IInjector,
1616
private $logger: ILogger,
17-
private $options: IOptions) {
18-
super(_device);
19-
}
17+
private $options: IOptions,
18+
$liveSyncProvider: ILiveSyncProvider) {
19+
super(_device, $liveSyncProvider);
20+
}
2021

2122
public removeFiles(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
2223
return (() => {

lib/services/livesync/livesync-service-base.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ export abstract class LiveSyncServiceBase<T extends Mobile.IDevice> {
33
return <T>(this._device);
44
}
55

6-
constructor(private _device: Mobile.IDevice) { }
6+
constructor(private _device: Mobile.IDevice,
7+
private $liveSyncProvider: ILiveSyncProvider) { }
78

8-
public refreshApplication(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], canExecuteFastSync?: boolean): IFuture<void> {
9+
public refreshApplication(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[]): IFuture<void> {
10+
let canExecuteFastSync = localToDevicePaths &&
11+
_.all(localToDevicePaths, localToDevicePath => this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), deviceAppData.platform));
912
if (canExecuteFastSync) {
1013
return this.reloadPage(deviceAppData);
1114
}

lib/services/test-execution-service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ class TestExecutionService implements ITestExecutionService {
234234
appIdentifier: this.$projectData.projectId,
235235
projectFilesPath: projectFilesPath,
236236
syncWorkingDirectory: path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME),
237-
canExecuteFastSync: false, // Always restart the application when change is detected, so tests will be rerun.
238237
excludedProjectDirsAndFiles: this.$options.release ? constants.LIVESYNC_EXCLUDED_FILE_PATTERNS : []
239238
};
240239

0 commit comments

Comments
 (0)