Skip to content

Commit c2a73eb

Browse files
antonisitaybredenrasenoahsmartin
authored
chore(e2e): Cocoa-v9: Bump E2E to iOS 15.0 (#5369)
* fix: Fixes SentryScreenFrames use after being converted to Swift * Fix build * Use non-experimental enableLogs * bump target * remove enable tracing * Update enableLogs tests * chore: Fix RNSentry after SentryFramesTracker conversion to swift * Run linter * Remove unused debug image provider imports * Remove imports * chore: Remove deprecated user property * chore: Remove use of deprecate integrations API (#5304) * Remove use of integrations in tests * chore: Remove use of deprecated prop (#5322) * ref: Move options to wrapper * chore(sample): Bump MacOS sample to macos 12.0 wich is the minimum for v9 * chore(e2e): Cocoa-v9: Bump E2E to iOS 15.0 * Bump to 15.1 due to RN 0.81.0 requirements --------- Co-authored-by: Itay Brenner <itay.brenner@sentry.io> Co-authored-by: Itay Brenner <itaybrenner@hotmail.com> Co-authored-by: Denis Andrasec <denrase@gmail.com> Co-authored-by: Noah Martin <noahm444@gmail.com>
1 parent 8aea859 commit c2a73eb

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

dev-packages/e2e-tests/patch-scripts/rn.patch.podfile.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ if (enableHermes === null) {
2121
throw new Error('Invalid engine');
2222
}
2323

24+
// Optional iOS version argument, defaults to '15.1' due to Cocoa SDK V9 and RN 0.81.0 requirement
25+
const iosVersion = args['ios-version'] || '15.1';
26+
2427
debug.log('Patching Podfile', args['pod-file']);
25-
const content = fs.readFileSync(args['pod-file'], 'utf8');
28+
let content = fs.readFileSync(args['pod-file'], 'utf8');
2629

2730
const isHermesEnabled = content.includes(':hermes_enabled => true,');
2831
const shouldPatch = enableHermes !== isHermesEnabled;
2932
if (shouldPatch) {
30-
const patched = content.replace(
33+
content = content.replace(
3134
/:hermes_enabled.*/,
3235
enableHermes ? ':hermes_enabled => true,' : ':hermes_enabled => false,',
3336
);
@@ -36,7 +39,34 @@ if (shouldPatch) {
3639
} else {
3740
debug.log('Patching Podfile for JSC');
3841
}
39-
fs.writeFileSync(args['pod-file'], patched);
42+
}
43+
44+
// Patch iOS version
45+
const platformPattern = /platform :ios, (min_ios_version_supported|['"][0-9.]+['"])/;
46+
const currentMatch = content.match(platformPattern);
47+
48+
if (currentMatch) {
49+
const currentValue = currentMatch[1];
50+
const shouldPatchVersion = currentValue === 'min_ios_version_supported' ||
51+
currentValue !== `'${iosVersion}'`;
52+
53+
if (shouldPatchVersion) {
54+
content = content.replace(
55+
platformPattern,
56+
`platform :ios, '${iosVersion}'`
57+
);
58+
debug.log(`Patching iOS version to ${iosVersion} (was: ${currentValue})`);
59+
} else {
60+
debug.log(`iOS version already set to ${iosVersion}`);
61+
}
62+
} else {
63+
debug.log('Warning: Could not find platform :ios line to patch');
64+
}
65+
66+
// Write the file if any changes were made
67+
if (shouldPatch || currentMatch) {
68+
fs.writeFileSync(args['pod-file'], content);
69+
debug.log('Podfile patched successfully!');
4070
} else {
4171
debug.log('Podfile is already patched!');
4272
}

0 commit comments

Comments
 (0)