diff --git a/CodePush.podspec b/CodePush.podspec index 57260e7..13630fe 100644 --- a/CodePush.podspec +++ b/CodePush.podspec @@ -3,7 +3,6 @@ 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'] @@ -15,26 +14,14 @@ 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.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 + s.dependency 'SSZipArchive', '~> 2.1' + s.dependency 'JWT', '~> 3.0.0-beta.7' + s.dependency 'Base64', '~> 1.1' end diff --git a/docs/setup-ios.md b/docs/setup-ios.md index e3692e7..ba659cf 100644 --- a/docs/setup-ios.md +++ b/docs/setup-ios.md @@ -38,21 +38,9 @@ And that's it! Isn't RNPM awesome? :) pod 'CodePush', :path => '../node_modules/react-native-code-push' ``` - 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: The above path needs to be relative to your app's `Podfile`, so adjust it as necessary.* - ```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* + *NOTE: `JWT` library should be >= version 3.0.x* 2. Run `pod install`