-
Notifications
You must be signed in to change notification settings - Fork 345
fix(cocoapods): Resolve CocoaPods dependencies defined via :path: entries #10442
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10442 +/- ##
=========================================
Coverage 56.75% 56.75%
Complexity 1642 1642
=========================================
Files 337 337
Lines 12480 12480
Branches 1177 1177
=========================================
Hits 7083 7083
Misses 4945 4945
Partials 452 452
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
plugins/package-managers/cocoapods/src/main/kotlin/PodDependencyHandler.kt
Outdated
Show resolved
Hide resolved
plugins/package-managers/cocoapods/src/main/kotlin/PodDependencyHandler.kt
Show resolved
Hide resolved
nodeModulesParentDir.resolve("node_modules/react-native/scripts/react_native_pods.rb") | ||
if (reactNativePath.isFile) { | ||
val rubyContent = generateSequence(parentFile) { it.parentFile } | ||
.map { it.resolve("node_modules/react-native/scripts/react_native_pods.rb") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be combined with the line below, but no need for that.
plugins/package-managers/cocoapods/src/main/kotlin/PodDependencyHandler.kt
Outdated
Show resolved
Hide resolved
...ge-managers/cocoapods/src/funTest/assets/projects/synthetic/react-native-expected-output.yml
Show resolved
Hide resolved
plugins/package-managers/cocoapods/src/main/kotlin/PodDependencyHandler.kt
Show resolved
Hide resolved
plugins/package-managers/cocoapods/src/main/kotlin/PodDependencyHandler.kt
Show resolved
Hide resolved
Writing the patched podspec file in a temp directory broke relative paths used in some podspecs (e.g. to `package.json`). Storing it alongside the original podspec file ensures the CocoaPods command `pod ipc spec` evaluates it with proper path resolution. Signed-off-by: Onur Demirci <[email protected]>
The previous implementation updated only the `externalSources` in the lockfile by copying the Lockfile object and replacing it with resolved paths. However, this shallow update was insufficient because the nested pod dependencies still referened the original unresolved paths. This commit reconstructs the entire lockfile structure using resolved absolute paths for the external sources. This guarantess that all path references within the lockfile are consistent and correctly resolved. Signed-off-by: Onur Demirci <[email protected]>
Use the `--silent` flag with `pod ipc spec` to suppress warnings or status messages. Without this flag, the command output can include additional text alongside the JSON, making it invalid and unparseable. Signed-off-by: Onur Demirci <[email protected]>
Replace the upward search for the nearest `node_modules` directory by traversing up the directory tree and checking for the full path to the `react_native_pods.rb` script at each level. The previous logic stopped at the first `node_modules` directory found, which could incorrectly resolve to a nested one inside another package (e.g. `node_modules/ react-native/node_modules`) leading to a broken path. Signed-off-by: Onur Demirci <[email protected]>
Support resolving podspec files for pods defined with `:path:` in `Podfile.lock` by checking the specified directory for the podspec file. This is commonly used for React Native pods located in `node_modules` directory. Signed-off-by: Onur Demirci <[email protected]>
Merging despite the unrelated test failure(s). |
Check individual commit messages for details.