-
-
Notifications
You must be signed in to change notification settings - Fork 359
chore(deps): Bump E2E tests to 0.84.0 #5492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6d7e56f
91c5d97
2b81c80
c9bd738
f666885
d58633f
e88d8f6
da75b2d
26999bb
1e0e8e0
b5ab8c4
135da92
a34cc50
5b01251
46348ad
414e1c4
fed421b
7162526
d0338e4
a31efab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,22 +25,79 @@ debug.log('Patching react-native-launch-arguments build.gradle', buildGradlePath | |
|
|
||
| if (!fs.existsSync(buildGradlePath)) { | ||
| debug.log('build.gradle not found, skipping patch'); | ||
| return; | ||
| } else { | ||
| const buildGradle = fs.readFileSync(buildGradlePath, 'utf8'); | ||
|
|
||
| // Replace destinationDir with destinationDirectory.get() for Gradle 9+ compatibility | ||
| const isPatched = buildGradle.includes('destinationDirectory.get()'); | ||
| if (!isPatched) { | ||
| const patched = buildGradle.replace( | ||
| /\.destinationDir\b/g, | ||
| '.destinationDirectory.get()' | ||
| ); | ||
|
|
||
| fs.writeFileSync(buildGradlePath, patched); | ||
| debug.log('Patched react-native-launch-arguments build.gradle successfully!'); | ||
| } else { | ||
| debug.log('react-native-launch-arguments build.gradle is already patched!'); | ||
| } | ||
| } | ||
|
|
||
| const buildGradle = fs.readFileSync(buildGradlePath, 'utf8'); | ||
| // Patch iOS podspec for React Native 0.71+ compatibility | ||
| // Replace 'React' with install_modules_dependencies() to fix RCTRegisterModule undefined symbol error in RN 0.84+ with dynamic frameworks | ||
| const podspecPath = path.join( | ||
| args['app-dir'], | ||
| 'node_modules', | ||
| 'react-native-launch-arguments', | ||
| 'react-native-launch-arguments.podspec' | ||
| ); | ||
|
|
||
| debug.log('Patching react-native-launch-arguments podspec', podspecPath); | ||
|
|
||
| if (fs.existsSync(podspecPath)) { | ||
| const podspec = fs.readFileSync(podspecPath, 'utf8'); | ||
| debug.log('Found podspec, checking for React dependency...'); | ||
|
|
||
| // Check if already patched with install_modules_dependencies | ||
| const isPatched = podspec.includes('install_modules_dependencies'); | ||
| const hasReactDep = /s\.dependency\s+['"]React['"]/.test(podspec); | ||
| const hasReactCoreDep = /s\.dependency\s+['"]React\/Core['"]/.test(podspec); | ||
| const hasReactCoreDepOnly = podspec.includes("s.dependency 'React-Core'") || podspec.includes('s.dependency "React-Core"'); | ||
|
|
||
| debug.log(`Podspec status: isPatched=${isPatched}, hasReactDep=${hasReactDep}, hasReactCoreDep=${hasReactCoreDep}, hasReactCoreDepOnly=${hasReactCoreDepOnly}`); | ||
|
|
||
| if (!isPatched && (hasReactDep || hasReactCoreDep || hasReactCoreDepOnly)) { | ||
| let patched = podspec; | ||
|
|
||
| // Replace any React dependency with install_modules_dependencies(s) | ||
| // This is the modern approach that works with all framework configurations (static, dynamic, etc.) | ||
| // and automatically includes the correct React Native dependencies | ||
| const installModulesDepsBlock = ` | ||
| if defined? install_modules_dependencies | ||
| install_modules_dependencies(s) | ||
| else | ||
| s.dependency "React-Core" | ||
| end`; | ||
|
|
||
| // Replace destinationDir with destinationDirectory.get() for Gradle 9+ compatibility | ||
| const isPatched = buildGradle.includes('destinationDirectory.get()'); | ||
| if (!isPatched) { | ||
| const patched = buildGradle.replace( | ||
| /\.destinationDir\b/g, | ||
| '.destinationDirectory.get()' | ||
| ); | ||
| if (hasReactDep) { | ||
| debug.log("Replacing s.dependency 'React' with install_modules_dependencies(s)"); | ||
| patched = patched.replace(/\s+s\.dependency\s+['"]React['"]\s*\n/g, installModulesDepsBlock + '\n'); | ||
| } else if (hasReactCoreDep) { | ||
| debug.log("Replacing s.dependency 'React/Core' with install_modules_dependencies(s)"); | ||
| patched = patched.replace(/\s+s\.dependency\s+['"]React\/Core['"]\s*\n/g, installModulesDepsBlock + '\n'); | ||
| } else if (hasReactCoreDepOnly) { | ||
| debug.log("Replacing s.dependency 'React-Core' with install_modules_dependencies(s)"); | ||
| patched = patched.replace(/\s+s\.dependency\s+['"]React-Core['"]\s*\n/g, installModulesDepsBlock + '\n'); | ||
| } | ||
|
|
||
| fs.writeFileSync(buildGradlePath, patched); | ||
| debug.log('Patched react-native-launch-arguments build.gradle successfully!'); | ||
| fs.writeFileSync(podspecPath, patched); | ||
| debug.log('Patched react-native-launch-arguments podspec successfully!'); | ||
|
Comment on lines
+84
to
+94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The regex for detecting a dependency is more permissive than the regex for replacing it, which can cause the patch to fail silently while reporting success. Suggested FixUnify the detection and replacement logic. Either make the replacement regex more flexible to not require a trailing newline, or make the detection regex stricter to match the replacement's requirements. Additionally, verify that the file content has changed after the replacement operation before reporting success. Prompt for AI Agent |
||
| } else if (isPatched) { | ||
| debug.log('react-native-launch-arguments podspec is already patched!'); | ||
| } else { | ||
| debug.log('Podspec does not contain React dependency - may already use install_modules_dependencies'); | ||
| } | ||
| } else { | ||
| debug.log('react-native-launch-arguments build.gradle is already patched!'); | ||
| debug.log('podspec not found, skipping iOS patch'); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.