Skip to content

Commit dcd0835

Browse files
committed
Add support iOS entitlements
1 parent a437436 commit dcd0835

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/tools/scaffold.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ function updateXCConfigFile(content: string, params: ScaffoldProjectParams): str
216216
);
217217
}
218218
}
219+
220+
// Update entitlements path for iOS
221+
result = result.replace(
222+
/CODE_SIGN_ENTITLEMENTS = .+/g,
223+
`CODE_SIGN_ENTITLEMENTS = Config/${params.projectName}.entitlements`,
224+
);
219225
} else if (params.platform === 'macOS') {
220226
const macosParams = params as ScaffoldmacOSProjectParams & { platform: 'macOS' };
221227

@@ -230,13 +236,19 @@ function updateXCConfigFile(content: string, params: ScaffoldProjectParams): str
230236
// Update entitlements path for macOS
231237
result = result.replace(
232238
/CODE_SIGN_ENTITLEMENTS = .+/g,
233-
`CODE_SIGN_ENTITLEMENTS = ${params.projectName}/${params.projectName}.entitlements`,
239+
`CODE_SIGN_ENTITLEMENTS = Config/${params.projectName}.entitlements`,
234240
);
235241
}
236242

237243
// Update test bundle identifier and target name
238244
result = result.replace(/TEST_TARGET_NAME = .+/g, `TEST_TARGET_NAME = ${params.projectName}`);
239245

246+
// Update comments that reference MyProject in entitlements paths
247+
result = result.replace(
248+
/Config\/MyProject\.entitlements/g,
249+
`Config/${params.projectName}.entitlements`,
250+
);
251+
240252
return result;
241253
}
242254

0 commit comments

Comments
 (0)