Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 58be2bc

Browse files
iwasrobbed-ksitoys
authored andcommitted
[CocoaPods] Resolve dependencies at parent level (#1210)
* [CocoaPods] Let it resolve dependencies This is necessary versus using subspecs since CocoaPods needs to be able to resolve the dependencies properly at the parent workspace level based on needed versions. Otherwise, you end up with very opaque linking errors.
1 parent 14c2530 commit 58be2bc

File tree

2 files changed

+10
-35
lines changed

2 files changed

+10
-35
lines changed

CodePush.podspec

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ require 'json'
33
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
44

55
Pod::Spec.new do |s|
6-
76
s.name = 'CodePush'
87
s.version = package['version'].gsub(/v|-beta/, '')
98
s.summary = package['description']
@@ -15,26 +14,14 @@ Pod::Spec.new do |s|
1514
s.tvos.deployment_target = '9.0'
1615
s.preserve_paths = '*.js'
1716
s.library = 'z'
17+
s.source_files = 'ios/CodePush/*.{h,m}'
18+
s.public_header_files = ['ios/CodePush/CodePush.h']
1819

20+
# Note: Even though there are copy/pasted versions of some of these dependencies in the repo,
21+
# we explicitly let CocoaPods pull in the versions below so all dependencies are resolved and
22+
# linked properly at a parent workspace level.
1923
s.dependency 'React'
20-
21-
s.subspec 'Core' do |ss|
22-
ss.source_files = 'ios/CodePush/*.{h,m}'
23-
ss.public_header_files = ['ios/CodePush/CodePush.h']
24-
end
25-
26-
s.subspec 'SSZipArchive' do |ss|
27-
ss.source_files = 'ios/CodePush/SSZipArchive/*.{h,m}', 'ios/CodePush/SSZipArchive/aes/*.{h,c}', 'ios/CodePush/SSZipArchive/minizip/*.{h,c}'
28-
ss.private_header_files = 'ios/CodePush/SSZipArchive/*.h', 'ios/CodePush/SSZipArchive/aes/*.h', 'ios/CodePush/SSZipArchive/minizip/*.h'
29-
end
30-
31-
s.subspec 'JWT' do |jwt|
32-
jwt.source_files = 'ios/CodePush/JWT/**/*.{h,m}'
33-
jwt.private_header_files = 'ios/CodePush/JWT/**/*.h'
34-
end
35-
36-
s.subspec 'Base64' do |base64|
37-
base64.source_files = 'ios/CodePush/Base64/**/*.{h,m}'
38-
base64.private_header_files = 'ios/CodePush/Base64/**/*.h'
39-
end
24+
s.dependency 'SSZipArchive', '~> 2.1'
25+
s.dependency 'JWT', '~> 3.0.0-beta.7'
26+
s.dependency 'Base64', '~> 1.1'
4027
end

docs/setup-ios.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,9 @@ And that's it! Isn't RNPM awesome? :)
3838
pod 'CodePush', :path => '../node_modules/react-native-code-push'
3939
```
4040
41-
CodePush depends on an internal copy of the `SSZipArchive`, `JWT` and `Base64` libraries, so if your project already includes some of them (either directly or via a transitive dependency), then you can install a version of CodePush which excludes it by depending specifically on the needed subspecs:
41+
*NOTE: The above path needs to be relative to your app's `Podfile`, so adjust it as necessary.*
4242
43-
```ruby
44-
# `SSZipArchive`, `JWT` and `Base64` already in use
45-
pod 'CodePush', :path => '../node_modules/react-native-code-push', :subspecs => ['Core']
46-
47-
# or for example
48-
49-
# `SSZipArchive` and `Base64` already in use
50-
pod 'CodePush', :path => '../node_modules/react-native-code-push', :subspecs => ['Core', 'JWT']
51-
```
52-
53-
*NOTE: The above paths needs to be relative to your app's `Podfile`, so adjust it as neccessary.*
54-
55-
*NOTE: `JWT` library should be of version 3.0.x*
43+
*NOTE: `JWT` library should be >= version 3.0.x*
5644
5745
2. Run `pod install`
5846

0 commit comments

Comments
 (0)