@@ -52,6 +52,27 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
52
52
} ) ;
53
53
}
54
54
55
+ public async syncFiles ( data : IPreviewAppLiveSyncData , filesToSync : string [ ] , filesToRemove : string [ ] ) : Promise < void > {
56
+ this . showWarningsForNativeFiles ( filesToSync ) ;
57
+
58
+ for ( const device of this . $previewSdkService . connectedDevices ) {
59
+ await this . $previewAppPluginsService . comparePluginsOnDevice ( data , device ) ;
60
+ }
61
+
62
+ const platforms = _ ( this . $previewSdkService . connectedDevices )
63
+ . map ( device => device . platform )
64
+ . uniq ( )
65
+ . value ( ) ;
66
+
67
+ for ( const platform of platforms ) {
68
+ await this . syncFilesForPlatformSafe ( data , platform , { filesToSync, filesToRemove, useHotModuleReload : data . appFilesUpdaterOptions . useHotModuleReload } ) ;
69
+ }
70
+ }
71
+
72
+ public async stopLiveSync ( ) : Promise < void > {
73
+ this . $previewSdkService . stop ( ) ;
74
+ }
75
+
55
76
private async initializePreviewForDevice ( data : IPreviewAppLiveSyncData , device : Device ) : Promise < FilesPayload > {
56
77
const filesToSyncMap : IDictionary < string [ ] > = { } ;
57
78
const hmrData : IDictionary < IPlatformHmrData > = { } ;
@@ -98,27 +119,6 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
98
119
return payloads ;
99
120
}
100
121
101
- public async syncFiles ( data : IPreviewAppLiveSyncData , filesToSync : string [ ] , filesToRemove : string [ ] ) : Promise < void > {
102
- this . showWarningsForNativeFiles ( filesToSync ) ;
103
-
104
- for ( const device of this . $previewSdkService . connectedDevices ) {
105
- await this . $previewAppPluginsService . comparePluginsOnDevice ( data , device ) ;
106
- }
107
-
108
- const platforms = _ ( this . $previewSdkService . connectedDevices )
109
- . map ( device => device . platform )
110
- . uniq ( )
111
- . value ( ) ;
112
-
113
- for ( const platform of platforms ) {
114
- await this . syncFilesForPlatformSafe ( data , platform , { filesToSync, filesToRemove, useHotModuleReload : data . appFilesUpdaterOptions . useHotModuleReload } ) ;
115
- }
116
- }
117
-
118
- public async stopLiveSync ( ) : Promise < void > {
119
- this . $previewSdkService . stop ( ) ;
120
- }
121
-
122
122
private async syncFilesForPlatformSafe ( data : IPreviewAppLiveSyncData , platform : string , opts ?: ISyncFilesOptions ) : Promise < FilesPayload > {
123
123
this . $logger . info ( `Start syncing changes for platform ${ platform } .` ) ;
124
124
0 commit comments