@@ -14,14 +14,15 @@ export abstract class PlatformLiveSyncServiceBase {
1414
1515 public getDeviceLiveSyncService ( device : Mobile . IDevice , projectData : IProjectData ) : INativeScriptDeviceLiveSyncService {
1616 const key = device . deviceInfo . identifier + projectData . projectId ;
17+ const frameworkVersion = this . $platformsData . getPlatformData ( device . deviceInfo . platform , projectData ) . platformProjectService . getFrameworkVersion ( projectData ) ;
1718 if ( ! this . _deviceLiveSyncServicesCache [ key ] ) {
18- this . _deviceLiveSyncServicesCache [ key ] = this . _getDeviceLiveSyncService ( device , projectData ) ;
19+ this . _deviceLiveSyncServicesCache [ key ] = this . _getDeviceLiveSyncService ( device , projectData , frameworkVersion ) ;
1920 }
2021
2122 return this . _deviceLiveSyncServicesCache [ key ] ;
2223 }
2324
24- protected abstract _getDeviceLiveSyncService ( device : Mobile . IDevice , data : IProjectDir ) : INativeScriptDeviceLiveSyncService ;
25+ protected abstract _getDeviceLiveSyncService ( device : Mobile . IDevice , data : IProjectData , frameworkVersion : string ) : INativeScriptDeviceLiveSyncService ;
2526
2627 public async refreshApplication ( projectData : IProjectData , liveSyncInfo : ILiveSyncResultInfo ) : Promise < void > {
2728 if ( liveSyncInfo . isFullSync || liveSyncInfo . modifiedFilesData . length ) {
@@ -44,7 +45,7 @@ export abstract class PlatformLiveSyncServiceBase {
4445
4546 const projectFilesPath = path . join ( platformData . appDestinationDirectoryPath , APP_FOLDER_NAME ) ;
4647 const localToDevicePaths = await this . $projectFilesManager . createLocalToDevicePaths ( deviceAppData , projectFilesPath , null , [ ] ) ;
47- const modifiedFilesData = await this . transferFiles ( deviceAppData , localToDevicePaths , projectFilesPath , true ) ;
48+ const modifiedFilesData = await this . transferFiles ( deviceAppData , localToDevicePaths , projectFilesPath , true , projectData ) ;
4849
4950 return {
5051 modifiedFilesData,
@@ -77,7 +78,7 @@ export abstract class PlatformLiveSyncServiceBase {
7778 const localToDevicePaths = await this . $projectFilesManager . createLocalToDevicePaths ( deviceAppData ,
7879 projectFilesPath , existingFiles , [ ] ) ;
7980 modifiedLocalToDevicePaths . push ( ...localToDevicePaths ) ;
80- modifiedLocalToDevicePaths = await this . transferFiles ( deviceAppData , localToDevicePaths , projectFilesPath , false ) ;
81+ modifiedLocalToDevicePaths = await this . transferFiles ( deviceAppData , localToDevicePaths , projectFilesPath , false , projectData ) ;
8182 }
8283 }
8384
@@ -94,7 +95,7 @@ export abstract class PlatformLiveSyncServiceBase {
9495 modifiedLocalToDevicePaths . push ( ...localToDevicePaths ) ;
9596
9697 const deviceLiveSyncService = this . getDeviceLiveSyncService ( device , projectData ) ;
97- await deviceLiveSyncService . removeFiles ( deviceAppData , localToDevicePaths ) ;
98+ await deviceLiveSyncService . removeFiles ( deviceAppData , localToDevicePaths , projectFilesPath ) ;
9899 }
99100
100101 return {
@@ -104,13 +105,11 @@ export abstract class PlatformLiveSyncServiceBase {
104105 } ;
105106 }
106107
107- protected async transferFiles ( deviceAppData : Mobile . IDeviceAppData , localToDevicePaths : Mobile . ILocalToDevicePathData [ ] , projectFilesPath : string , isFullSync : boolean ) : Promise < Mobile . ILocalToDevicePathData [ ] > {
108+ protected async transferFiles ( deviceAppData : Mobile . IDeviceAppData , localToDevicePaths : Mobile . ILocalToDevicePathData [ ] , projectFilesPath : string , isFullSync : boolean , projectData : IProjectData ) : Promise < Mobile . ILocalToDevicePathData [ ] > {
108109 let transferredFiles : Mobile . ILocalToDevicePathData [ ] = [ ] ;
109- if ( isFullSync ) {
110- transferredFiles = await deviceAppData . device . fileSystem . transferDirectory ( deviceAppData , localToDevicePaths , projectFilesPath ) ;
111- } else {
112- transferredFiles = await deviceAppData . device . fileSystem . transferFiles ( deviceAppData , localToDevicePaths ) ;
113- }
110+ const deviceLiveSyncService = this . getDeviceLiveSyncService ( deviceAppData . device , projectData ) ;
111+
112+ transferredFiles = await deviceLiveSyncService . transferFiles ( deviceAppData , localToDevicePaths , projectFilesPath , isFullSync ) ;
114113
115114 this . logFilesSyncInformation ( transferredFiles , "Successfully transferred %s." , this . $logger . info ) ;
116115
0 commit comments