From 58f0bfc336fc6892040fcac64797dcda959d5639 Mon Sep 17 00:00:00 2001 From: Jonathan Carter Date: Mon, 23 May 2016 17:58:25 -0700 Subject: [PATCH] Adding nozip option to podspec --- CodePush.podspec | 13 +++++++++++-- README.md | 10 ++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CodePush.podspec b/CodePush.podspec index daf11d3..7af6b8b 100644 --- a/CodePush.podspec +++ b/CodePush.podspec @@ -12,10 +12,19 @@ Pod::Spec.new do |s| s.homepage = 'http://microsoft.github.io/code-push/' s.source = { :git => 'https://github.com/Microsoft/react-native-code-push.git', :tag => "v#{s.version}-beta" } s.platform = :ios, '7.0' - s.source_files = 'ios/CodePush/*.{h,m}', 'ios/CodePush/SSZipArchive/*.{h,m}', 'ios/CodePush/SSZipArchive/aes/*.{h,c}', 'ios/CodePush/SSZipArchive/minizip/*.{h,c}' s.public_header_files = 'ios/CodePush/CodePush.h' s.preserve_paths = '*.js' s.library = 'z' s.dependency 'React' - + + s.default_subspec = 'Full' + + s.subspec 'Full' do |ss| + s.source_files = 'ios/CodePush/*.{h,m}', 'ios/CodePush/SSZipArchive/*.{h,m}', 'ios/CodePush/SSZipArchive/aes/*.{h,c}', 'ios/CodePush/SSZipArchive/minizip/*.{h,c}' + end + + s.subspec 'NoZip' do |ss| + s.source_files = 'ios/CodePush/*.{h,m}' + end + end \ No newline at end of file diff --git a/README.md b/README.md index 1df7996..fa8e636 100644 --- a/README.md +++ b/README.md @@ -118,12 +118,18 @@ We hope to eventually remove the need for steps #2-4, but in the meantime, RNPM 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 neccessary.* + CodePush depends on an internal copy of the `SSZipArchive` library, so if your project already includes that (either directly or via a transitive dependency), then you can install a version of CodePush which excludes its by using the following subspec: + + ```ruby + pod 'CodePush', :path => './node_modules/react-native-code-push', :subspecs => ['NoZip'] + ``` + + *NOTE: The above paths needs to be relative to your app's `Podfile`, so adjust it as neccessary.* 2. Run `pod install` *NOTE: The CodePush `.podspec` depends on the `React` pod, and so in order to ensure that it can correctly use the version of React Native that your app is built with, please make sure to define the `React` dependency in your app's `Podfile` as explained [here](http://facebook.github.io/react-native/docs/embedded-app-ios.html#install-react-native-using-cocoapods).* - + #### Plugin Installation (iOS - Manual) 1. Open your app's Xcode project