Entitlements reference check compares forward-slash paths on every OS (false 'not referenced by CODE_SIGN_ENTITLEMENTS' on Windows); test, pitfall 103
This commit is contained in:
parent
e7874a2c25
commit
cbba936ed8
4 changed files with 33 additions and 3 deletions
18
tests/entitlements-ref.test.ts
Normal file
18
tests/entitlements-ref.test.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// The entitlements file the pbxproj names is "referenced" on every OS (Windows paths use backslashes; pitfall 103).
|
||||
import { expect, test } from 'bun:test';
|
||||
import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { readProjectEntitlements } from '../cli/apple/signing';
|
||||
|
||||
test('CODE_SIGN_ENTITLEMENTS = App/App.entitlements matches ios/App/App/App.entitlements', () => {
|
||||
const root = mkdtempSync(join(tmpdir(), 'sb-ent-'));
|
||||
mkdirSync(join(root, 'ios/App/App.xcodeproj'), { recursive: true });
|
||||
mkdirSync(join(root, 'ios/App/App'), { recursive: true });
|
||||
writeFileSync(join(root, 'ios/App/App.xcodeproj/project.pbxproj'), 'buildSettings = { CODE_SIGN_ENTITLEMENTS = App/App.entitlements; };\n');
|
||||
writeFileSync(join(root, 'ios/App/App/App.entitlements'), '<plist><dict><key>com.apple.developer.game-center</key><true/></dict></plist>');
|
||||
const r = readProjectEntitlements(root)!;
|
||||
expect(r).toHaveLength(1);
|
||||
expect(r[0]!.file).toBe('ios/App/App/App.entitlements');
|
||||
expect(r[0]!.referenced).toBe(true);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue