@@ -3,34 +3,42 @@ source 'https://cdn.cocoapods.org/'
33project 'OHHTTPStubs.xcodeproj'
44inhibit_all_warnings!
55
6+ DEPLOYMENT_TARGET = {
7+ IPHONEOS : '12.0' ,
8+ MACOSX : '10.13' ,
9+ TVOS : '12.0'
10+ }
11+
612abstract_target 'TestingPods' do
713 pod 'AFNetworking' , '~> 3.0'
814
915 target 'OHHTTPStubs iOS Lib Tests' do
10- platform :ios , '12.0'
16+ platform :ios , DEPLOYMENT_TARGET [ :IPHONEOS ]
1117 end
1218
1319 target 'OHHTTPStubs iOS Fmk Tests' do
14- platform :ios , '12.0'
20+ platform :ios , DEPLOYMENT_TARGET [ :IPHONEOS ]
1521 end
1622
1723 target 'OHHTTPStubs Mac Tests' do
18- platform :osx , '10.13'
24+ platform :osx , DEPLOYMENT_TARGET [ :MACOSX ]
1925 end
2026
2127 target 'OHHTTPStubs tvOS Fmk Tests' do
22- platform :tvos , '12.0'
28+ platform :tvos , DEPLOYMENT_TARGET [ :TVOS ]
2329 end
2430end
2531
2632# Let Pods targets inherit deployment target from the app
2733# This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/4859
28- APP_IOS_DEPLOYMENT_TARGET = Gem ::Version . new ( '12.0' )
2934post_install do |installer |
3035 installer . pods_project . targets . each do |target |
3136 target . build_configurations . each do |configuration |
32- pod_ios_deployment_target = Gem ::Version . new ( configuration . build_settings [ 'IPHONEOS_DEPLOYMENT_TARGET' ] )
33- configuration . build_settings . delete 'IPHONEOS_DEPLOYMENT_TARGET' if pod_ios_deployment_target <= APP_IOS_DEPLOYMENT_TARGET
37+ DEPLOYMENT_TARGET . each do |platform , version |
38+ build_setting_name = "#{ platform } _DEPLOYMENT_TARGET"
39+ pod_deployment_target = Gem ::Version . new ( configuration . build_settings [ build_setting_name ] )
40+ configuration . build_settings . delete build_setting_name if pod_deployment_target <= Gem ::Version . new ( version )
41+ end
3442 end
3543 end
3644end
0 commit comments