Skip to content

swift_version in the Podspec isn't reflected in the generated Xcode project(s) #148

@Buzz-Lightyear

Description

@Buzz-Lightyear

My Pod requires Swift 5 to compile and I set it in the Podspec:

  s.swift_version = '5.0'

However, the generated Xcode project still sets the version to 4.0:

smuthu in ~/Sandbox/ios-video-player on branch master >grep 'SWIFT_VERSION = 4.0' ./ -r --color=auto -n
...
.//GeneratedWorkspace/Workspace/Pods/Pods.xcodeproj/project.pbxproj:9874:				SWIFT_VERSION = 4.0;
.//GeneratedWorkspace/Workspace/Pods/Pods.xcodeproj/project.pbxproj:9916:				SWIFT_VERSION = 4.0;
...
.//GeneratedWorkspace/Workspace/Workspace.xcodeproj/project.pbxproj:287:				SWIFT_VERSION = 4.0;
.//GeneratedWorkspace/Workspace/Workspace.xcodeproj/project.pbxproj:374:				SWIFT_VERSION = 4.0;

I was able to run

find . -name '*.pbxproj' -print0 | xargs -0 sed -i "" "s/SWIFT_VERSION\ =\ 4.0/SWIFT_VERSION\ =\ 5.0/g"

and confirmed that my targets build correctly.

cocoapods-generate should respect the swift_version flag and reflect it in the generated Xcode projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions