Skip to content

Commit 23a177b

Browse files
bs-ondemsschuberth
authored andcommitted
fix(cocoapods): Resolve podspecs for pods defined via :path
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]>
1 parent 9830caa commit 23a177b

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

plugins/package-managers/cocoapods/src/funTest/assets/projects/synthetic/react-native-expected-output.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ projects:
2626
- id: "Pod::React-Core:0.75.4"
2727
dependencies:
2828
- id: "Pod::glog:0.3.5"
29+
- id: "Pod::React-RCTActionSheet:0.79.3"
2930
- id: "Pod::fmt:9.1.0"
3031
- id: "Pod::glog:0.3.5"
3132
packages:
@@ -81,6 +82,34 @@ packages:
8182
url: ""
8283
revision: ""
8384
path: ""
85+
- id: "Pod::React-RCTActionSheet:0.79.3"
86+
purl: "pkg:cocoapods/[email protected]"
87+
declared_licenses:
88+
- "MIT"
89+
declared_licenses_processed:
90+
spdx_expression: "MIT"
91+
description: "An API for displaying iOS action sheets and share sheets."
92+
homepage_url: "https://reactnative.dev/"
93+
binary_artifact:
94+
url: ""
95+
hash:
96+
value: ""
97+
algorithm: ""
98+
source_artifact:
99+
url: ""
100+
hash:
101+
value: ""
102+
algorithm: ""
103+
vcs:
104+
type: "Git"
105+
url: "https://github.com/facebook/react-native.git"
106+
revision: "v0.75.4"
107+
path: ""
108+
vcs_processed:
109+
type: "Git"
110+
url: "https://github.com/facebook/react-native.git"
111+
revision: "v0.75.4"
112+
path: ""
84113
- id: "Pod::fmt:9.1.0"
85114
purl: "pkg:cocoapods/[email protected]"
86115
declared_licenses:

plugins/package-managers/cocoapods/src/funTest/assets/projects/synthetic/react-native/ios/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ target 'example' do
33
pod 'glog'
44
pod 'React'
55
pod 'React-Core'
6+
pod 'React-RCTActionSheet'
67
end

plugins/package-managers/cocoapods/src/funTest/assets/projects/synthetic/react-native/ios/Podfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@ PODS:
55
- React-Core (0.75.4):
66
- glog
77
- fmt (9.1.0)
8+
- React-RCTActionSheet (0.79.3)
89

910
DEPENDENCIES:
1011
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
1112
- React (from `../node_modules/react-native/`)
1213
- React-Core (from `../node_modules/react-native/`)
1314
- fmt (from `../node_modules/react-native/third-party-podspecs/fmt.podspec`)
15+
- React-RCTActionSheet (from `node_modules/react-native/Libraries/ActionSheetIOS`)
1416

1517
EXTERNAL SOURCES:
1618
fmt:
1719
:podspec: "../node_modules/react-native/third-party-podspecs/fmt.podspec"
20+
React-RCTActionSheet:
21+
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
1822

1923
COCOAPODS: 1.13.0

plugins/package-managers/cocoapods/src/main/kotlin/PodDependencyHandler.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ internal class PodDependencyHandler : DependencyHandler<Lockfile.Pod> {
8181
val podspec = podspecCache.getOrPut(basePodName) {
8282
// Lazily only call the pod CLI if the podspec is not available from the external source.
8383
val podspecFile = sequence {
84+
yield(dependency.externalSource?.path?.let { "$it/$basePodName.podspec" })
8485
yield(dependency.externalSource?.podspec)
8586
yield(getPodspecPath(basePodName, dependency.version))
8687
}.firstNotNullOfOrNull { path ->

0 commit comments

Comments
 (0)