From e1a8b92939fd9356f6dc31f71a7d14d917ebdd1c Mon Sep 17 00:00:00 2001 From: IT-MikeS <20338451+IT-MikeS@users.noreply.github.com> Date: Thu, 21 Jul 2022 10:10:58 -0400 Subject: [PATCH 1/3] feat: post install script for deployment target --- ios-template/App/Podfile | 5 +++++ ios/scripts/pods_helpers.rb | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 ios/scripts/pods_helpers.rb diff --git a/ios-template/App/Podfile b/ios-template/App/Podfile index 8594fc2cdd..0dcc5f1225 100644 --- a/ios-template/App/Podfile +++ b/ios-template/App/Podfile @@ -1,3 +1,5 @@ +require_relative '../node_modules/@capacitor/ios/scripts/pods_helpers' + platform :ios, '13.0' use_frameworks! @@ -13,5 +15,8 @@ end target 'App' do capacitor_pods + post_install do |installer| + assertDeploymentTarget(installer) + end # Add your Pods here end diff --git a/ios/scripts/pods_helpers.rb b/ios/scripts/pods_helpers.rb new file mode 100644 index 0000000000..7a9fa41f42 --- /dev/null +++ b/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 \ No newline at end of file From d63d27c1f2a15d764d634060167a62b52870c77e Mon Sep 17 00:00:00 2001 From: IT-MikeS <20338451+IT-MikeS@users.noreply.github.com> Date: Thu, 21 Jul 2022 10:21:39 -0400 Subject: [PATCH 2/3] chore: fix path to helper file --- ios-template/App/Podfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios-template/App/Podfile b/ios-template/App/Podfile index 0dcc5f1225..5efc275cb9 100644 --- a/ios-template/App/Podfile +++ b/ios-template/App/Podfile @@ -1,4 +1,4 @@ -require_relative '../node_modules/@capacitor/ios/scripts/pods_helpers' +require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers' platform :ios, '13.0' use_frameworks! From f66862a41f7d51dbfc841067b77f0714391117d0 Mon Sep 17 00:00:00 2001 From: IT-MikeS <20338451+IT-MikeS@users.noreply.github.com> Date: Wed, 27 Jul 2022 09:41:36 -0400 Subject: [PATCH 3/3] chore: put post_install in better spot --- ios-template/App/Podfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ios-template/App/Podfile b/ios-template/App/Podfile index 5efc275cb9..affb695cb6 100644 --- a/ios-template/App/Podfile +++ b/ios-template/App/Podfile @@ -15,8 +15,9 @@ end target 'App' do capacitor_pods - post_install do |installer| - assertDeploymentTarget(installer) - end # Add your Pods here end + +post_install do |installer| + assertDeploymentTarget(installer) +end