Skip to content

Commit

Permalink
Add check for application identifier ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristian D. Dimitrov committed Aug 4, 2017
1 parent 0a7408a commit 9ddc173
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
handler,
this.buildForSimulator(projectRoot, basicArgs, projectData, buildConfig.buildOutputStdio));
}

this.validateApplicationIdentifier(projectData);
}

public async validatePlugins(projectData: IProjectData): Promise<void> {
Expand Down Expand Up @@ -1312,6 +1314,23 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
}
return teamId;
}

private validateApplicationIdentifier(projectData: IProjectData): void {
const projectDir = projectData.projectDir;
const infoPlistPath = path.join(projectDir, constants.APP_FOLDER_NAME, constants.APP_RESOURCES_FOLDER_NAME, this.getPlatformData(projectData).normalizedPlatformName, this.getPlatformData(projectData).configurationFileName);
const mergedPlistPath = this.getPlatformData(projectData).configurationFilePath;

if (!this.$fs.exists(infoPlistPath) || !this.$fs.exists(mergedPlistPath)) {
return;
}

const infoPlist = plist.parse(this.$fs.readText(infoPlistPath));
const mergedPlist = plist.parse(this.$fs.readText(mergedPlistPath));

if (infoPlist.CFBundleIdentifier && infoPlist.CFBundleIdentifier !== mergedPlist.CFBundleIdentifier) {
this.$logger.warnWithLabel("The CFBundleIdentifier key inside the 'Info.plist' will be overriden by the 'id' inside 'package.json'.");
}
}
}

$injector.register("iOSProjectService", IOSProjectService);

0 comments on commit 9ddc173

Please sign in to comment.