Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for application identifier ios #3033

Merged
merged 1 commit into from
Aug 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe some trace message would be useful here, so we figure out what's wrong if the user has problems

Copy link
Contributor Author

@KristianDD KristianDD Aug 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens pretty late in the build process. I am pretty sure the build would have failed if Info.plist was missing. I will check if it is handled earlier in the build process.

}

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);