You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I wish I could apply variable logic when defining iOS deployment target in the application Podfile.
To set the IPHONEOS_DEPLOYMENT_TARGET we must define the platform version in two separate files to ensure both the target application and all dependencies meet our minimum desired version.
As suggested in the troubleshooting documentation, to ensure that all dependencies are also configured to this target it is suggested that we do the following... which works fine.
platform :ios, '13.0'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
end
end
This makes 3 places where I need to update the target version for iOS.
Inspired by this answer, if I try to apply any kind of logic in the application Podfile, it is either stripped by the CocoaPodsPlatformManager or ignored altogether.
It looks like the Regex is trying to match a platform within quotes('") only. ^\\s*?#\\s*?(platform\\b\\s*?\\:\\s*?ios\\b(?:,\\s*?['"](.+)['"])?)
Ruby will also complain the variable app_ios_deployment_target does not exist, which is true because only the line matched by the Regex above is hoisted above any post_install hooks and all other code blocks are lost.
It would also be great if all other lines that are not the platform definition and are outside of hooks are hoisted first, so that variables could be used.
This could mean that we can have one source of truth when defining the iOS target. Which could be in App_Resources/iOS/build.xcconfig and the read from the Podfile, or better yet an environment variable.
Is your feature request related to a problem? Please describe.
I wish I could apply variable logic when defining iOS deployment target in the application Podfile.
To set the
IPHONEOS_DEPLOYMENT_TARGET
we must define the platform version in two separate files to ensure both the target application and all dependencies meet our minimum desired version.IPHONEOS_DEPLOYMENT_TARGET=16
platform :ios, '16.0'
As suggested in the troubleshooting documentation, to ensure that all dependencies are also configured to this target it is suggested that we do the following... which works fine.
*See https://docs.nativescript.org/troubleshooting#cocoapods-could-not-find-compatible-versions-for-pod-higher-minimum-deployment-target
This makes 3 places where I need to update the target version for iOS.
Inspired by this answer, if I try to apply any kind of logic in the application Podfile, it is either stripped by the CocoaPodsPlatformManager or ignored altogether.
Doing this:
Results in this:
It looks like the Regex is trying to match a platform within quotes('") only.
^\\s*?#\\s*?(platform\\b\\s*?\\:\\s*?ios\\b(?:,\\s*?['"](.+)['"])?)
Ruby will also complain the variable
app_ios_deployment_target
does not exist, which is true because only the line matched by the Regex above is hoisted above any post_install hooks and all other code blocks are lost.Describe the solution you'd like
It would be great if CocoaPodsPlatformManager.selectPlatformDataFromProjectPodfile could be expanded to match other expressions.
It would also be great if all other lines that are not the platform definition and are outside of hooks are hoisted first, so that variables could be used.
This could mean that we can have one source of truth when defining the iOS target. Which could be in
App_Resources/iOS/build.xcconfig
and the read from the Podfile, or better yet an environment variable.Describe alternatives you've considered
No response
Anything else?
No response
Please accept these terms
The text was updated successfully, but these errors were encountered: