Skip to content
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

Add Multiple Swift Versions Support #174

Closed
wants to merge 10 commits into from

Conversation

jakeholland
Copy link
Contributor

With Cocoapods 1.7.0 we are now able to specify support for multiple swift versions at once. This PR bumps the minimum Cocoapods version to 1.7.0 and adds explicit support for Swift versions 4.0, 4.1, 4.2, and 5.0. Valet's version has also been bumped to 3.2.4.

@jakeholland
Copy link
Contributor Author

Looks like CI is using "Bundler version 1.15.4" and the bundle file is using Bundler version 2. Checking into it.

Copy link
Collaborator

@dfed dfed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! I'll let @dnkoutso do the final approval as he understands CP v1.7 better than I do. I just have one question.

Valet.podspec Outdated
@@ -1,12 +1,13 @@
Pod::Spec.new do |s|
s.name = 'Valet'
s.version = '3.2.3'
s.version = '3.2.4'
s.cocoapods_version = '>= 1.7.0'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this line entail? Is this change backwards compatible?

Copy link
Collaborator

@dnkoutso dnkoutso May 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is. I was just about to comment to that. It should be backwards compatible all the way back to CocoaPods 1.4.0 when the swift_version (singular) DSL was first introduced.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this line btw. Once this PR lands prior versions all the way down to 1.4.0 will pick Swift 5.0 as their version.

@dnkoutso
Copy link
Collaborator

@dfed
Copy link
Collaborator

dfed commented May 24, 2019

@jakeholland re Bundler, you should be able to run gem install bundler -v 1.16.1 if you have that version of bundler installed and then bundle install. I think it'll pass CI if you do that.

Edit: looks like gem install bundler -v X installs version X for you. Good stuff.

@dnkoutso
Copy link
Collaborator

Hm saw the build failure. I will debug.

@dnkoutso
Copy link
Collaborator

Oh its because of Xcode 9

@dnkoutso
Copy link
Collaborator

Need to bump that. lint will always use the latest version of Swift supported unless you specify --swift-version in the command as a parameter

@jakeholland
Copy link
Contributor Author

@dnkoutso - Would you rather I specify the Xcode version, or bump the Xcode version in the .travis.yml?

@dnkoutso
Copy link
Collaborator

If we say 5.0 is the latest supported version our default should lint against that so I recommend bumping...@dfed you OK with that?

Additionally we can setup multiple jobs one per Swift version we support and use --swift-version to ensure lint passes for all the versions we claim to support. This was as designed by the Swift versions DSL feature.

@jakeholland
Copy link
Contributor Author

jakeholland commented May 24, 2019

@dnkoutso - I am cool with either option, just bumping is obviously the easiest. But, if we update the jobs to include all supported Swift versions that would be the safest option. 🤔

EDIT: One thing to keep in mind is that we will still have to bump the Xcode version in general if we want to test against 5.0.

@dnkoutso
Copy link
Collaborator

You might need to be on Xcode 10.2 which was the first Xcode to support Swift 5.

@jakeholland
Copy link
Contributor Author

You might need to be on Xcode 10.2 which was the first Xcode to support Swift 5.

Good call!

@dfed
Copy link
Collaborator

dfed commented May 24, 2019

The downside of bumping: we no longer have a CI check on our lowest-supported Xcode version, which can lead to potential compiler issues. See how CI caught an Xcode 9 build failure here: #173

Linting on the swift version supported by CI seems fine. Alternatively, we could try running CI over multiple machines, but that seems out of scope for this PR. I'd prefer for us to continue to use the minimum supported Xcode version in CI if at all possible.

@dfed
Copy link
Collaborator

dfed commented May 24, 2019

If we get #175 working (it's looking promising), we can rebase this PR on top of master and lint on multiple swift/Xcode versions pretty easily.

@dnkoutso
Copy link
Collaborator

If #175 lands then we can just update this PR to pass --swift-version for the Xcode 9 build.

@dfed
Copy link
Collaborator

dfed commented May 25, 2019

It’s merged! Please rebase. I made it easy for you to add the Swift version flag in CI too! Just change this line.

@@ -1738,6 +1738,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = 3;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Valet tvOS Test Host App.app/Valet tvOS Test Host App";
TVOS_DEPLOYMENT_TARGET = 12.2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the changes to this file.

@jakeholland
Copy link
Contributor Author

Closing in favor of #178 Since this has a bunch of unneeded commits

@jakeholland jakeholland deleted the Cocoapods-1.7.0 branch May 27, 2019 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants