@@ -26,16 +26,11 @@ import {
26
26
IPackageInstallationManager ,
27
27
IPackageManager ,
28
28
IPlatformCommandHelper ,
29
- IPlatformValidationService ,
30
29
} from "../declarations" ;
31
- import {
32
- IAddPlatformService ,
33
- IPlatformsDataService ,
34
- } from "../definitions/platform" ;
30
+ import { IPlatformsDataService } from "../definitions/platform" ;
35
31
import { IPluginsService } from "../definitions/plugins" ;
36
32
import {
37
33
IChildProcess ,
38
- IDictionary ,
39
34
IErrors ,
40
35
IFileSystem ,
41
36
IResourceLoader ,
@@ -67,15 +62,12 @@ export class MigrateController
67
62
protected $packageManager : IPackageManager ,
68
63
protected $pacoteService : IPacoteService ,
69
64
// private $androidResourcesMigrationService: IAndroidResourcesMigrationService,
70
- private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
71
65
private $logger : ILogger ,
72
66
private $errors : IErrors ,
73
- private $addPlatformService : IAddPlatformService ,
74
67
private $pluginsService : IPluginsService ,
75
68
private $projectDataService : IProjectDataService ,
76
69
private $projectConfigService : IProjectConfigService ,
77
70
private $options : IOptions ,
78
- private $platformValidationService : IPlatformValidationService ,
79
71
private $resources : IResourceLoader ,
80
72
private $injector : IInjector ,
81
73
private $settingsService : ISettingsService ,
@@ -284,20 +276,46 @@ export class MigrateController
284
276
desiredVersion : "~1.39.0" ,
285
277
isDev : true ,
286
278
} ,
279
+
280
+ // runtimes
281
+ {
282
+ packageName : "tns-ios" ,
283
+ minVersion : "6.5.3" ,
284
+ replaceWith : "@nativescript/ios" ,
285
+ isDev : true ,
286
+ } ,
287
+ {
288
+ packageName : "tns-android" ,
289
+ minVersion : "6.5.4" ,
290
+ replaceWith : "@nativescript/android" ,
291
+ isDev : true ,
292
+ } ,
293
+ {
294
+ packageName : "@nativescript/ios" ,
295
+ minVersion : "6.5.3" ,
296
+ desiredVersion : "~8.1.0" ,
297
+ isDev : true ,
298
+ } ,
299
+ {
300
+ packageName : "@nativescript/android" ,
301
+ minVersion : "7.0.0" ,
302
+ desiredVersion : "~8.1.0" ,
303
+ isDev : true ,
304
+ } ,
287
305
] ;
288
306
289
- get verifiedPlatformVersions ( ) : IDictionary < IDependencyVersion > {
290
- return {
291
- [ this . $devicePlatformsConstants . Android . toLowerCase ( ) ] : {
292
- minVersion : "6.5.3" ,
293
- desiredVersion : "~8.0 .0" , // :::8.1.0
294
- } ,
295
- [ this . $devicePlatformsConstants . iOS . toLowerCase ( ) ] : {
296
- minVersion : "6.5.4" ,
297
- desiredVersion : "~8.0 .0" , // :::8.1.0
298
- } ,
299
- } ;
300
- }
307
+ // get verifiedPlatformVersions(): IDictionary<IDependencyVersion> {
308
+ // return {
309
+ // [this.$devicePlatformsConstants.Android.toLowerCase()]: {
310
+ // minVersion: "6.5.3",
311
+ // desiredVersion: "~8.1 .0", // :::8.1.0
312
+ // },
313
+ // [this.$devicePlatformsConstants.iOS.toLowerCase()]: {
314
+ // minVersion: "6.5.4",
315
+ // desiredVersion: "~8.1 .0", // :::8.1.0
316
+ // },
317
+ // };
318
+ // }
301
319
302
320
public async shouldMigrate ( {
303
321
projectDir,
@@ -631,50 +649,49 @@ export class MigrateController
631
649
}
632
650
}
633
651
634
- for ( let platform of platforms ) {
635
- platform = platform ?. toLowerCase ( ) ;
652
+ // for (let platform of platforms) {
653
+ // platform = platform?.toLowerCase();
636
654
637
- if (
638
- ! this . $platformValidationService . isValidPlatform ( platform , projectData )
639
- ) {
640
- continue ;
641
- }
655
+ // if (
656
+ // !this.$platformValidationService.isValidPlatform(platform, projectData)
657
+ // ) {
658
+ // continue;
659
+ // }
642
660
643
- const hasRuntimeDependency = this . hasRuntimeDependency ( {
644
- platform,
645
- projectData,
646
- } ) ;
661
+ // const hasRuntimeDependency = this.hasRuntimeDependency({
662
+ // platform,
663
+ // projectData,
664
+ // });
647
665
648
- if ( ! hasRuntimeDependency ) {
649
- continue ;
650
- }
666
+ // if (!hasRuntimeDependency) {
667
+ // continue;
668
+ // }
651
669
652
- const verifiedPlatformVersion = this . verifiedPlatformVersions [
653
- platform . toLowerCase ( )
654
- ] ;
655
- const shouldUpdateRuntime = await this . shouldUpdateRuntimeVersion (
656
- verifiedPlatformVersion ,
657
- platform ,
658
- projectData ,
659
- loose
660
- ) ;
670
+ // const verifiedPlatformVersion =
671
+ // this.verifiedPlatformVersions[platform.toLowerCase()];
672
+ // const shouldUpdateRuntime = await this.shouldUpdateRuntimeVersion(
673
+ // verifiedPlatformVersion,
674
+ // platform,
675
+ // projectData,
676
+ // loose
677
+ // );
661
678
662
- if ( ! shouldUpdateRuntime ) {
663
- continue ;
664
- }
679
+ // if (!shouldUpdateRuntime) {
680
+ // continue;
681
+ // }
665
682
666
- this . $logger . trace (
667
- `${ shouldMigrateCommonMessage } Platform '${ platform } ' should be updated.`
668
- ) ;
669
- if ( loose ) {
670
- this . $logger . warn (
671
- `Platform '${ platform } ' should be updated. The minimum version supported is ${ verifiedPlatformVersion . minVersion } `
672
- ) ;
673
- continue ;
674
- }
675
-
676
- return true ;
677
- }
683
+ // this.$logger.trace(
684
+ // `${shouldMigrateCommonMessage}Platform '${platform}' should be updated.`
685
+ // );
686
+ // if (loose) {
687
+ // this.$logger.warn(
688
+ // `Platform '${platform}' should be updated. The minimum version supported is ${verifiedPlatformVersion.minVersion}`
689
+ // );
690
+ // continue;
691
+ // }
692
+
693
+ // return true;
694
+ // }
678
695
679
696
return false ;
680
697
}
@@ -706,20 +723,6 @@ export class MigrateController
706
723
) ;
707
724
}
708
725
709
- private async shouldUpdateRuntimeVersion (
710
- version : IDependencyVersion ,
711
- platform : string ,
712
- projectData : IProjectData ,
713
- loose : boolean
714
- ) : Promise < boolean > {
715
- const installedVersion = await this . getMaxRuntimeVersion ( {
716
- platform,
717
- projectData,
718
- } ) ;
719
-
720
- return this . isOutdatedVersion ( installedVersion , version , loose ) ;
721
- }
722
-
723
726
private async getCachedShouldMigrate (
724
727
projectDir : string ,
725
728
platform : string
@@ -1046,48 +1049,47 @@ export class MigrateController
1046
1049
await this . migrateDependency ( dependency , projectData , loose ) ;
1047
1050
}
1048
1051
1049
- for ( const platform of platforms ) {
1050
- const lowercasePlatform = platform . toLowerCase ( ) ;
1051
- const hasRuntimeDependency = this . hasRuntimeDependency ( {
1052
- platform,
1053
- projectData,
1054
- } ) ;
1052
+ // for (const platform of platforms) {
1053
+ // const lowercasePlatform = platform.toLowerCase();
1054
+ // const hasRuntimeDependency = this.hasRuntimeDependency({
1055
+ // platform,
1056
+ // projectData,
1057
+ // });
1055
1058
1056
- if ( ! hasRuntimeDependency ) {
1057
- continue ;
1058
- }
1059
+ // if (!hasRuntimeDependency) {
1060
+ // continue;
1061
+ // }
1059
1062
1060
- const shouldUpdate = await this . shouldUpdateRuntimeVersion (
1061
- this . verifiedPlatformVersions [ lowercasePlatform ] ,
1062
- platform ,
1063
- projectData ,
1064
- loose
1065
- ) ;
1063
+ // const shouldUpdate = await this.shouldUpdateRuntimeVersion(
1064
+ // this.verifiedPlatformVersions[lowercasePlatform],
1065
+ // platform,
1066
+ // projectData,
1067
+ // loose
1068
+ // );
1066
1069
1067
- if ( ! shouldUpdate ) {
1068
- continue ;
1069
- }
1070
+ // if (!shouldUpdate) {
1071
+ // continue;
1072
+ // }
1070
1073
1071
- const verifiedPlatformVersion = this . verifiedPlatformVersions [
1072
- lowercasePlatform
1073
- ] ;
1074
- const platformData = this . $platformsDataService . getPlatformData (
1075
- lowercasePlatform ,
1076
- projectData
1077
- ) ;
1074
+ // const verifiedPlatformVersion =
1075
+ // this.verifiedPlatformVersions[lowercasePlatform];
1076
+ // const platformData = this.$platformsDataService.getPlatformData(
1077
+ // lowercasePlatform,
1078
+ // projectData
1079
+ // );
1078
1080
1079
- this . spinner . info (
1080
- `Updating ${ platform } platform to version ${ verifiedPlatformVersion . desiredVersion . green } .`
1081
- ) ;
1081
+ // this.spinner.info(
1082
+ // `Updating ${platform} platform to version ${verifiedPlatformVersion.desiredVersion.green}.`
1083
+ // );
1082
1084
1083
- await this . $addPlatformService . setPlatformVersion (
1084
- platformData ,
1085
- projectData ,
1086
- verifiedPlatformVersion . desiredVersion
1087
- ) ;
1085
+ // await this.$addPlatformService.setPlatformVersion(
1086
+ // platformData,
1087
+ // projectData,
1088
+ // verifiedPlatformVersion.desiredVersion
1089
+ // );
1088
1090
1089
- this . spinner . succeed ( ) ;
1090
- }
1091
+ // this.spinner.succeed();
1092
+ // }
1091
1093
}
1092
1094
1093
1095
private async migrateDependency (
0 commit comments