Created
July 14, 2016 14:35
-
-
Save tolpp/0c878c9ab87049f2f174bf1a519e1d2e to your computer and use it in GitHub Desktop.
CocoaPods Podfile post_install script for adding swift_version property to targets or pod_project. You can use this post_install script if you are working with pods that not compatible with Swift 3.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set true if all pods in the pod_project needs to be flaggged as swift 2.3 | |
legacy_swift_pods_project = true | |
# Array for pods that will be flagged as swift version 2.3 | |
# if legacy_swift_pods_project is true, you don't need to add any item in array. | |
legacy_swift_pods = ['Alamofire'] | |
post_install do |installer| | |
if legacy_swift_pods_project | |
installer.pods_project.build_configurations.each do |config| | |
config.build_settings['SWIFT_VERSION'] = '2.3' | |
end | |
end | |
installer.pods_project.targets.each do |target| | |
if legacy_swift_pods.include? target.name | |
target.build_configurations.each do |config| | |
config.build_settings['SWIFT_VERSION'] = '2.3' | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment