Skip to content

Commit

Permalink
Make iOS deployment version a Ruby constant in Podfile
Browse files Browse the repository at this point in the history
Just for consistency with the file path and to write what is hopefully
more idiomatic Ruby.
  • Loading branch information
mokagio committed Jun 6, 2023
1 parent 24344b0 commit b3ce619
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ source 'https://cdn.cocoapods.org/'
raise 'Please run CocoaPods via `bundle exec`' unless %w[BUNDLE_BIN_PATH BUNDLE_GEMFILE].any? { |k| ENV.key?(k) }

VERSION_XCCONFIG_PATH = File.join(File.expand_path(__dir__), 'config', 'Common.xcconfig')
app_ios_deployment_target = Gem::Version.new(Xcodeproj::Config.new(VERSION_XCCONFIG_PATH).to_hash['IPHONEOS_DEPLOYMENT_TARGET'])
APP_IOS_DEPLOYMENT_TARGET = Gem::Version.new(Xcodeproj::Config.new(VERSION_XCCONFIG_PATH).to_hash['IPHONEOS_DEPLOYMENT_TARGET'])

platform :ios, app_ios_deployment_target.version
platform :ios, APP_IOS_DEPLOYMENT_TARGET.version
inhibit_all_warnings!
use_frameworks!
workspace 'WordPress.xcworkspace'
Expand Down Expand Up @@ -395,7 +395,7 @@ post_install do |installer|

target.build_configurations.each do |configuration|
pod_ios_deployment_target = Gem::Version.new(configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
configuration.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' if pod_ios_deployment_target <= app_ios_deployment_target
configuration.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' if pod_ios_deployment_target <= APP_IOS_DEPLOYMENT_TARGET
end
end

Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,6 @@ SPEC CHECKSUMS:
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37

PODFILE CHECKSUM: c7c2c52286d19a44c43428c8f4bb5647e1014861
PODFILE CHECKSUM: c4bdcbac21a417ad5d771fc6fe99602db67b4fa8

COCOAPODS: 1.11.3

0 comments on commit b3ce619

Please sign in to comment.