Skip to content

Commit 0001b7a

Browse files
committed
Do not create empty .entitlements file
Fixes #3481
1 parent bf3969b commit 0001b7a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/services/ios-entitlements-service.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ export class IOSEntitlementsService {
5656
makePatch(appEntitlementsPath);
5757
}
5858

59-
const plistContent = session.build();
60-
this.$logger.trace("App.entitlements: Write to: " + this.getPlatformsEntitlementsPath(projectData));
61-
this.$fs.writeFile(this.getPlatformsEntitlementsPath(projectData), plistContent);
62-
return;
59+
if (session.patches && session.patches.length > 0) {
60+
const plistContent = session.build();
61+
this.$logger.trace("App.entitlements: Write to: " + this.getPlatformsEntitlementsPath(projectData));
62+
this.$fs.writeFile(this.getPlatformsEntitlementsPath(projectData), plistContent);
63+
}
6364
}
6465

6566
private getAllInstalledPlugins(projectData: IProjectData): Promise<IPluginData[]> {

lib/services/ios-project-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
12411241

12421242
// Set Entitlements Property to point to default file if not set explicitly by the user.
12431243
const entitlementsPropertyValue = this.$xCConfigService.readPropertyValue(pluginsXcconfigFilePath, constants.CODE_SIGN_ENTITLEMENTS);
1244-
if (entitlementsPropertyValue === null) {
1244+
if (entitlementsPropertyValue === null && this.$fs.exists(this.$iOSEntitlementsService.getPlatformsEntitlementsPath(projectData))) {
12451245
temp.track();
12461246
const tempEntitlementsDir = temp.mkdirSync("entitlements");
12471247
const tempEntitlementsFilePath = path.join(tempEntitlementsDir, "set-entitlements.xcconfig");

0 commit comments

Comments
 (0)