Skip to content

Commit

Permalink
feat(iOS): post install script for deployment target (#5783)
Browse files Browse the repository at this point in the history
* feat: post install script for deployment target

* chore: fix path to helper file

* chore: put post_install in better spot

Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
  • Loading branch information
IT-MikeS and jcesarmobile committed Jul 27, 2022
1 parent dd16478 commit f5afa94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ios-template/App/Podfile
@@ -1,3 +1,5 @@
require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers'

platform :ios, '13.0'
use_frameworks!

Expand All @@ -15,3 +17,7 @@ target 'App' do
capacitor_pods
# Add your Pods here
end

post_install do |installer|
assertDeploymentTarget(installer)
end
12 changes: 12 additions & 0 deletions ios/scripts/pods_helpers.rb
@@ -0,0 +1,12 @@
def assertDeploymentTarget(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# ensure IPHONEOS_DEPLOYMENT_TARGET is at least 13.0
deployment_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f
should_upgrade = deployment_target < 13.0 && deployment_target != 0.0
if should_upgrade
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
end

0 comments on commit f5afa94

Please sign in to comment.