Skip to content

Commit

Permalink
Fix podspec
Browse files Browse the repository at this point in the history
- The Offline subspec does not support OS X.

- Online sources are now duplicated in the Offline subspec.

- Cocoapods won’t let us target iOS 7 because we are using Swift and Cocoapods uses dynamic frameworks. Although the code should work on iOS 7 when used in source form (this is why the deployment target remains unchanged in Xcode), we set the deployment target to iOS 8 when using Cocoapods.
  • Loading branch information
Clément Le Provost committed May 26, 2016
1 parent 5f38654 commit 97846ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions AlgoliaSearch-Client-Swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ Pod::Spec.new do |s|
s.author = { 'Algolia' => 'contact@algolia.com' }
s.source = { :git => 'https://github.com/algolia/algoliasearch-client-swift.git', :tag => s.version }

s.ios.deployment_target = '7.0'
s.osx.deployment_target = '10.10'
s.ios.deployment_target = '8.0'

# By default, do not require the offline Core.
s.default_subspec = 'Online'

# Online-only API client.
s.subspec 'Online' do |online|
online.ios.deployment_target = '8.0'
online.osx.deployment_target = '10.10'
# No additional dependency.
# WARNING: Cocoapods complains when a subspec is empty, so we must define something additional here to keep
# it satisfied.
Expand All @@ -35,6 +36,10 @@ Pod::Spec.new do |s|
'GCC_PREPROCESSOR_DEFINITIONS' => 'ALGOLIA_SDK=1',
'OTHER_SWIFT_FLAGS' => '-DALGOLIA_SDK'
}
offline.source_files = 'Source/Offline/*.swift'
offline.source_files = [
'Source/*.swift',
'Source/Helpers/*.swift',
'Source/Offline/*.swift'
]
end
end

0 comments on commit 97846ea

Please sign in to comment.