Skip to content

Commit 06e238f

Browse files
committed
fix: app id migration when using separate ids
1 parent 1b53682 commit 06e238f

File tree

3 files changed

+58
-30
lines changed

3 files changed

+58
-30
lines changed

lib/controllers/migrate-controller.ts

+26-14
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,38 @@ import * as _ from "lodash";
66
import { UpdateControllerBase } from "./update-controller-base";
77
import { fromWindowsRelativePathToUnix, getHash } from "../common/helpers";
88
import {
9-
IProjectDataService,
10-
IProjectData,
119
IProjectConfigService,
10+
IProjectData,
11+
IProjectDataService,
1212
} from "../definitions/project";
1313
import {
1414
IMigrateController,
15-
IMigrationDependency,
1615
IMigrationData,
16+
IMigrationDependency,
1717
} from "../definitions/migrate";
1818
import {
19-
IPlatformCommandHelper,
19+
IOptions,
2020
IPackageInstallationManager,
2121
IPackageManager,
22-
// IAndroidResourcesMigrationService,
22+
IPlatformCommandHelper,
2323
IPlatformValidationService,
24-
IOptions,
2524
} from "../declarations";
2625
import {
27-
IPlatformsDataService,
2826
IAddPlatformService,
27+
IPlatformsDataService,
2928
} from "../definitions/platform";
3029
import { IPluginsService } from "../definitions/plugins";
3130
import {
32-
IFileSystem,
31+
IDictionary,
3332
IErrors,
34-
ISettingsService,
33+
IFileSystem,
3534
IResourceLoader,
36-
IDictionary,
35+
ISettingsService,
3736
} from "../common/declarations";
3837
import { IInjector } from "../common/definitions/yok";
3938
import { injector } from "../common/yok";
4039
import { IJsonFileSettingsService } from "../common/definitions/json-file-settings-service";
40+
4141
// import { project } from "nativescript-dev-xcode";
4242

4343
export 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

package-lock.json

+31-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nativescript",
33
"preferGlobal": true,
4-
"version": "7.0.4",
4+
"version": "7.0.5-rc.0",
55
"author": "NativeScript <[email protected]>",
66
"description": "Command-line interface for building NativeScript projects",
77
"bin": {

0 commit comments

Comments
 (0)