privacy manifest discovery skips build-output and copy folders (hidden dirs like .native-build, build, DerivedData, node_modules, dist, Products, built .app / .xcarchive) in scan, check and privacy-manifest: a stale .native-build copy was checked instead of the real ios/ manifest; test

This commit is contained in:
CRTkafa 2026-10-14 13:14:49 +08:00
parent 7219ded3e8
commit 73db689386
4 changed files with 49 additions and 4 deletions

View file

@ -6,7 +6,7 @@
import { readdirSync, readFileSync, statSync } from 'node:fs';
import { basename, dirname, extname, join, relative, sep } from 'node:path';
import { resolvePackage } from '../node-packages';
import { type Manifest, parseManifest } from '../privacy-manifest';
import { isBuildCopyPath, type Manifest, parseManifest } from '../privacy-manifest';
import { type DepRef, type Eco, matchesSdk, SDKS, type SdkDef } from './sdks';
export interface Loc { file: string; line: number }
@ -371,7 +371,7 @@ export function detectProject(root: string): ProjectFacts {
} else if (n.endsWith('.entitlements')) {
const { value, lines } = parsePlist(read(f));
for (const [k, v] of Object.entries(value)) setKey(entitlements, k, v, { file: f, line: lines.get(k) ?? 1 });
} else if (n === 'PrivacyInfo.xcprivacy') privacyManifests.push(parseManifest(f, read(f)));
} else if (n === 'PrivacyInfo.xcprivacy') { if (!isBuildCopyPath(f)) privacyManifests.push(parseManifest(f, read(f))); }
else if (n === 'project.pbxproj') {
const t = read(f);
deps.push(...pbxproj(f, t));