Skip to content

Commit

Permalink
Revert "[CocoaPods] Resolve dependencies at parent level (microsoft#1210
Browse files Browse the repository at this point in the history
)"

This reverts commit 58be2bc.
  • Loading branch information
mistikk authored May 27, 2019
1 parent 06b875d commit 524d97b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
29 changes: 21 additions & 8 deletions CodePush.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|

s.name = 'CodePush'
s.version = package['version'].gsub(/v|-beta/, '')
s.summary = package['description']
Expand All @@ -14,14 +15,26 @@ Pod::Spec.new do |s|
s.tvos.deployment_target = '9.0'
s.preserve_paths = '*.js'
s.library = 'z'
s.source_files = 'ios/CodePush/*.{h,m}'
s.public_header_files = ['ios/CodePush/CodePush.h']

# Note: Even though there are copy/pasted versions of some of these dependencies in the repo,
# we explicitly let CocoaPods pull in the versions below so all dependencies are resolved and
# linked properly at a parent workspace level.
s.dependency 'React'
s.dependency 'SSZipArchive', '~> 2.1'
s.dependency 'JWT', '~> 3.0.0-beta.7'
s.dependency 'Base64', '~> 1.1'

s.subspec 'Core' do |ss|
ss.source_files = 'ios/CodePush/*.{h,m}'
ss.public_header_files = ['ios/CodePush/CodePush.h']
end

s.subspec 'SSZipArchive' do |ss|
ss.source_files = 'ios/CodePush/SSZipArchive/*.{h,m}', 'ios/CodePush/SSZipArchive/aes/*.{h,c}', 'ios/CodePush/SSZipArchive/minizip/*.{h,c}'
ss.private_header_files = 'ios/CodePush/SSZipArchive/*.h', 'ios/CodePush/SSZipArchive/aes/*.h', 'ios/CodePush/SSZipArchive/minizip/*.h'
end

s.subspec 'JWT' do |jwt|
jwt.source_files = 'ios/CodePush/JWT/**/*.{h,m}'
jwt.private_header_files = 'ios/CodePush/JWT/**/*.h'
end

s.subspec 'Base64' do |base64|
base64.source_files = 'ios/CodePush/Base64/**/*.{h,m}'
base64.private_header_files = 'ios/CodePush/Base64/**/*.h'
end
end
16 changes: 14 additions & 2 deletions docs/setup-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,21 @@ And that's it! Isn't RNPM awesome? :)
pod 'CodePush', :path => '../node_modules/react-native-code-push'
```
*NOTE: The above path needs to be relative to your app's `Podfile`, so adjust it as necessary.*
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:
*NOTE: `JWT` library should be >= version 3.0.x*
```ruby
# `SSZipArchive`, `JWT` and `Base64` already in use
pod 'CodePush', :path => '../node_modules/react-native-code-push', :subspecs => ['Core']
# or for example
# `SSZipArchive` and `Base64` already in use
pod 'CodePush', :path => '../node_modules/react-native-code-push', :subspecs => ['Core', 'JWT']
```
*NOTE: The above paths needs to be relative to your app's `Podfile`, so adjust it as neccessary.*
*NOTE: `JWT` library should be of version 3.0.x*
2. Run `pod install`
Expand Down

0 comments on commit 524d97b

Please sign in to comment.