New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SWIFT_VERSION
setting in s.pod_target_xcconfig
is not being respected.
#7327
Comments
SWIFT_VERSION
setting in s.pod_target_xcconfig
is not respected.SWIFT_VERSION
setting in s.pod_target_xcconfig
is not being respected.
The setting was overridden by the Pods project building setting. Looks like Cocoapods writes I tried to change SWIFT_VERSION of the main project, and Cocoapods is writing the same SWIFT_VERSION setting to all pod targets. This doesn't makes sense, this makes SWIFT_VERSION setting in |
There is a new DSL in 1.4.0.rc.1 Please use 1.4.0.rc.1 or wait for 1.4.0 to ship which hopefully should be next week. Going to close as already "fixed". |
Hey @dnkoutso, quick question: What is the default behavior if an existing pod doesn't have ex: we have a bunch of private pods that are currently in 3.2. We're releasing new versions of those pods that specify is that expected? |
@iwllyu I think so, for pods without swift_version specified, they are set with the same version as the main project. |
@iwllyu if there is no Code: # @return [String] the Swift version for the target. If the pod author has provided a swift version
# then that is the one returned, otherwise the Swift version is determined by the user
# targets that include this pod target.
#
def swift_version
spec_swift_version || target_definitions.map(&:swift_version).compact.uniq.first
end |
thanks for the quick answers, both of you |
Define swift_version for the Podfile which is read when the library is integrated If this is not supplied then Macaw in Pods settings of the integrated project gets the project's swift version which leads to a problem if the integrator is using different Swift version in his project For him the only workaround is to specify the post_install hook where he sets the config.build_settings['SWIFT_VERSION'] = '4.2' CocoaPods/CocoaPods#7327 For library developers who rely on this library this is also the problem because the s.pod_target_xcconfig is ignored when using the cocoapods-packager CocoaPods/cocoapods-packager#210
Report
What did you do?
Run
pod install
What did you expect to happen?
In the dependency's target build settings, SWIFT_VERSION should respect the pod's
pod_target_ xcconfig
setting in podspec file.For example, in SwifterSwift's podspec file, SWIFT_VERSION is explicitly set to 4.0 (https://github.com/SwifterSwift/SwifterSwift/blob/master/SwifterSwift.podspec#L24),
but when I use SwifterSwift in my project, after I run
pod install
then open the workspace, the SWIFT_VERSION setting of SwifterSwift target should be 4.0 (but it's not).What happened instead?
Continue with the example with SwifterSwift, the SWIFT_VERSION setting of SwifterSwift target should be 4.0, because podspec explicitly said that SwifterSwift wants to be compiled with Swift 4.0. But the SWIFT_VERSION setting is set to 3.2. Seems the xcconfig is generated, but in such a low priority so that being overridden by some default config?
CocoaPods Environment
Stack
Installation Source
Plugins
Podfile
Project that demonstrates the issue
PodTargetDemo.zip
Please extract the project and run
pod install
.The text was updated successfully, but these errors were encountered: