Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### Version 2.2.3

- Fix for privacy policy checks on XCode projects for Windows and Linux

### Version 2.2.1

- Add "Restart" button alongside "Stop" button for running scripts to stop and restart the script
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "webnative",
"displayName": "WebNative",
"description": "Create and maintain web and native projects",
"version": "2.2.2",
"version": "2.2.3",
"whatsNewRevision": 1,
"icon": "media/webnative.png",
"publisher": "WebNative",
Expand Down
1 change: 1 addition & 0 deletions src/rules-capacitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ function atVersionOfCapCLI(): string {
}

let podHasError = false;

async function getCocoaPodsVersion(project: Project, avoidCache?: boolean): Promise<string> {
if (podHasError) return undefined;
try {
Expand Down
22 changes: 18 additions & 4 deletions src/xcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ interface APIUsage {
const oneHour = 60 * 1000 * 60;

export async function checkPrivacyManifest(project: Project, context: ExtensionContext): Promise<void> {
// Privacy manifest is only relevant on macOS for iOS App Store submissions
if (process.platform !== 'darwin') {
return;
}

const lastManifestCheck = getLastManifestCheck(context);
if (lastManifestCheck < oneHour) {
return;
Expand Down Expand Up @@ -167,7 +172,7 @@ async function setPrivacyCategory(
});
}
plist.writeFileSync(privacyFilename, data);
clearRefreshCache(context);
await clearRefreshCache(context);
}

function XCodeProjFolder(project: Project): string {
Expand Down Expand Up @@ -225,7 +230,7 @@ async function createPrivacyManifest(queueFunction: QueueFunction, project: Proj
} catch (e) {
writeError(`Unable to create privacy manifest file: ${e}`);
}
clearRefreshCache(context);
await clearRefreshCache(context);
}

function writeManifestFile(iosFolder: string, filename: string): string {
Expand All @@ -247,10 +252,19 @@ function writeManifestFile(iosFolder: string, filename: string): string {
}

async function parse(path: string): Promise<any> {
return new Promise((resolve) => {
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
reject(new Error(`Timeout parsing Xcode project at ${path}`));
}, 5000); // 5 second timeout

const p = project(path);
p.parse((err: any) => {
resolve(p);
clearTimeout(timeout);
if (err) {
reject(err);
} else {
resolve(p);
}
});
});
}
Expand Down
Loading