@@ -26,16 +26,11 @@ import {
2626 IPackageInstallationManager ,
2727 IPackageManager ,
2828 IPlatformCommandHelper ,
29- IPlatformValidationService ,
3029} from "../declarations" ;
31- import {
32- IAddPlatformService ,
33- IPlatformsDataService ,
34- } from "../definitions/platform" ;
30+ import { IPlatformsDataService } from "../definitions/platform" ;
3531import { IPluginsService } from "../definitions/plugins" ;
3632import {
3733 IChildProcess ,
38- IDictionary ,
3934 IErrors ,
4035 IFileSystem ,
4136 IResourceLoader ,
@@ -67,15 +62,12 @@ export class MigrateController
6762 protected $packageManager : IPackageManager ,
6863 protected $pacoteService : IPacoteService ,
6964 // private $androidResourcesMigrationService: IAndroidResourcesMigrationService,
70- private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
7165 private $logger : ILogger ,
7266 private $errors : IErrors ,
73- private $addPlatformService : IAddPlatformService ,
7467 private $pluginsService : IPluginsService ,
7568 private $projectDataService : IProjectDataService ,
7669 private $projectConfigService : IProjectConfigService ,
7770 private $options : IOptions ,
78- private $platformValidationService : IPlatformValidationService ,
7971 private $resources : IResourceLoader ,
8072 private $injector : IInjector ,
8173 private $settingsService : ISettingsService ,
@@ -284,20 +276,46 @@ export class MigrateController
284276 desiredVersion : "~1.39.0" ,
285277 isDev : true ,
286278 } ,
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+ } ,
287305 ] ;
288306
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+ // }
301319
302320 public async shouldMigrate ( {
303321 projectDir,
@@ -631,50 +649,49 @@ export class MigrateController
631649 }
632650 }
633651
634- for ( let platform of platforms ) {
635- platform = platform ?. toLowerCase ( ) ;
652+ // for (let platform of platforms) {
653+ // platform = platform?.toLowerCase();
636654
637- if (
638- ! this . $platformValidationService . isValidPlatform ( platform , projectData )
639- ) {
640- continue ;
641- }
655+ // if (
656+ // !this.$platformValidationService.isValidPlatform(platform, projectData)
657+ // ) {
658+ // continue;
659+ // }
642660
643- const hasRuntimeDependency = this . hasRuntimeDependency ( {
644- platform,
645- projectData,
646- } ) ;
661+ // const hasRuntimeDependency = this.hasRuntimeDependency({
662+ // platform,
663+ // projectData,
664+ // });
647665
648- if ( ! hasRuntimeDependency ) {
649- continue ;
650- }
666+ // if (!hasRuntimeDependency) {
667+ // continue;
668+ // }
651669
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+ // );
661678
662- if ( ! shouldUpdateRuntime ) {
663- continue ;
664- }
679+ // if (!shouldUpdateRuntime) {
680+ // continue;
681+ // }
665682
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+ // }
678695
679696 return false ;
680697 }
@@ -706,20 +723,6 @@ export class MigrateController
706723 ) ;
707724 }
708725
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-
723726 private async getCachedShouldMigrate (
724727 projectDir : string ,
725728 platform : string
@@ -1046,48 +1049,47 @@ export class MigrateController
10461049 await this . migrateDependency ( dependency , projectData , loose ) ;
10471050 }
10481051
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+ // });
10551058
1056- if ( ! hasRuntimeDependency ) {
1057- continue ;
1058- }
1059+ // if (!hasRuntimeDependency) {
1060+ // continue;
1061+ // }
10591062
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+ // );
10661069
1067- if ( ! shouldUpdate ) {
1068- continue ;
1069- }
1070+ // if (!shouldUpdate) {
1071+ // continue;
1072+ // }
10701073
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+ // );
10781080
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+ // );
10821084
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+ // );
10881090
1089- this . spinner . succeed ( ) ;
1090- }
1091+ // this.spinner.succeed();
1092+ // }
10911093 }
10921094
10931095 private async migrateDependency (
0 commit comments