@@ -6,38 +6,38 @@ import * as _ from "lodash";
66import { UpdateControllerBase } from "./update-controller-base" ;
77import { fromWindowsRelativePathToUnix , getHash } from "../common/helpers" ;
88import {
9- IProjectDataService ,
10- IProjectData ,
119 IProjectConfigService ,
10+ IProjectData ,
11+ IProjectDataService ,
1212} from "../definitions/project" ;
1313import {
1414 IMigrateController ,
15- IMigrationDependency ,
1615 IMigrationData ,
16+ IMigrationDependency ,
1717} from "../definitions/migrate" ;
1818import {
19- IPlatformCommandHelper ,
19+ IOptions ,
2020 IPackageInstallationManager ,
2121 IPackageManager ,
22- // IAndroidResourcesMigrationService ,
22+ IPlatformCommandHelper ,
2323 IPlatformValidationService ,
24- IOptions ,
2524} from "../declarations" ;
2625import {
27- IPlatformsDataService ,
2826 IAddPlatformService ,
27+ IPlatformsDataService ,
2928} from "../definitions/platform" ;
3029import { IPluginsService } from "../definitions/plugins" ;
3130import {
32- IFileSystem ,
31+ IDictionary ,
3332 IErrors ,
34- ISettingsService ,
33+ IFileSystem ,
3534 IResourceLoader ,
36- IDictionary ,
35+ ISettingsService ,
3736} from "../common/declarations" ;
3837import { IInjector } from "../common/definitions/yok" ;
3938import { injector } from "../common/yok" ;
4039import { IJsonFileSettingsService } from "../common/definitions/json-file-settings-service" ;
40+
4141// import { project } from "nativescript-dev-xcode";
4242
4343export class MigrateController
@@ -891,10 +891,22 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`;
891891 rootPackageJsonData . nativescript &&
892892 rootPackageJsonData . nativescript . id
893893 ) {
894- await this . $projectConfigService . setValue (
895- "id" ,
896- rootPackageJsonData . nativescript . id
897- ) ;
894+ const ids = rootPackageJsonData . nativescript . id ;
895+
896+ if ( typeof ids === "string" ) {
897+ await this . $projectConfigService . setValue (
898+ "id" ,
899+ rootPackageJsonData . nativescript . id
900+ ) ;
901+ } else if ( typeof ids === "object" ) {
902+ for ( const platform of Object . keys ( ids ) ) {
903+ await this . $projectConfigService . setValue (
904+ `${ platform } .id` ,
905+ rootPackageJsonData . nativescript . id [ platform ]
906+ ) ;
907+ }
908+ // todo: what to do with a root level id - remove?
909+ }
898910 delete rootPackageJsonData . nativescript ;
899911 }
900912
0 commit comments