@@ -6,38 +6,38 @@ import * as _ from "lodash";
6
6
import { UpdateControllerBase } from "./update-controller-base" ;
7
7
import { fromWindowsRelativePathToUnix , getHash } from "../common/helpers" ;
8
8
import {
9
- IProjectDataService ,
10
- IProjectData ,
11
9
IProjectConfigService ,
10
+ IProjectData ,
11
+ IProjectDataService ,
12
12
} from "../definitions/project" ;
13
13
import {
14
14
IMigrateController ,
15
- IMigrationDependency ,
16
15
IMigrationData ,
16
+ IMigrationDependency ,
17
17
} from "../definitions/migrate" ;
18
18
import {
19
- IPlatformCommandHelper ,
19
+ IOptions ,
20
20
IPackageInstallationManager ,
21
21
IPackageManager ,
22
- // IAndroidResourcesMigrationService ,
22
+ IPlatformCommandHelper ,
23
23
IPlatformValidationService ,
24
- IOptions ,
25
24
} from "../declarations" ;
26
25
import {
27
- IPlatformsDataService ,
28
26
IAddPlatformService ,
27
+ IPlatformsDataService ,
29
28
} from "../definitions/platform" ;
30
29
import { IPluginsService } from "../definitions/plugins" ;
31
30
import {
32
- IFileSystem ,
31
+ IDictionary ,
33
32
IErrors ,
34
- ISettingsService ,
33
+ IFileSystem ,
35
34
IResourceLoader ,
36
- IDictionary ,
35
+ ISettingsService ,
37
36
} from "../common/declarations" ;
38
37
import { IInjector } from "../common/definitions/yok" ;
39
38
import { injector } from "../common/yok" ;
40
39
import { IJsonFileSettingsService } from "../common/definitions/json-file-settings-service" ;
40
+
41
41
// import { project } from "nativescript-dev-xcode";
42
42
43
43
export class MigrateController
@@ -891,10 +891,22 @@ Running this command will ${MigrateController.COMMON_MIGRATE_MESSAGE}`;
891
891
rootPackageJsonData . nativescript &&
892
892
rootPackageJsonData . nativescript . id
893
893
) {
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
+ }
898
910
delete rootPackageJsonData . nativescript ;
899
911
}
900
912
0 commit comments