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

[snapshot][examples] Fixed broken example project for trying out fastlane snapshot feature #18797

Conversation

bdolewski
Copy link
Contributor

@bdolewski bdolewski commented Jun 3, 2021

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Recently I decided to use fastlane snapshot for the first time. However I encounter the same issue as here: #18722

I tried to use minimal environment to see if it's working with bare minimum and decided to use this documentation:
https://docs.fastlane.tools/getting-started/ios/screenshots/ and clone the test code:

git clone https://github.com/fastlane/fastlane  # Clone the fastlane repo
cd fastlane/snapshot/example                    # Navigate to the example project
fastlane snapshot                               # Generate screenshots for the sample app

However it doesn't even build because the sample code is simply outdated.

Description

  • Updated Xcode project files to recommended settings
  • Updated Xcode project to use Swift 5
  • to be faithful with documentation then I removed the snappy lane and stick with Snapfile
  • updated test simulators to be iPhone 12 Pro Max and SE (2nd generation) instead of iPhones 6/7

Testing Steps

Just running fastlane snapshot like in documentation to see if I can get screenshots right.

@google-cla google-cla bot added the cla: yes label Jun 3, 2021
@bdolewski bdolewski changed the title Fixed broken example project for trying out fastlane snapshot feature [snapshot] [ examples] Fixed broken example project for trying out fastlane snapshot feature Jun 3, 2021
@bdolewski bdolewski changed the title [snapshot] [ examples] Fixed broken example project for trying out fastlane snapshot feature [snapshot][examples] Fixed broken example project for trying out fastlane snapshot feature Jun 3, 2021
@minuscorp
Copy link
Collaborator

We keep the old configuration settings to ensure compatibility with all further versions. This project must be unchanged she if something fails to compile I think we rather fix the issue than changing the whole project.

@joshdholtz
Copy link
Member

@minuscorp This update is needed 😀👇 The project itself was super old and needed an upgrade. This seems like a good update so the project actually does run 😇

Screen Shot 2021-06-05 at 3 25 49 PM

Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

One thing that feels a little bit weird about this is the SnapshotHelper.swift file being committed into the project because it could become out of date. But at the same time... the project works perfectly by just running fastlane snapshot and it's super easy to update SnapshotHelper.swift when running the example project again.

The upgrade to Swift 5 is also totally needed! This is 🔥 Thanks so much for fixing this!

@bdolewski
Copy link
Contributor Author

Thanks @joshdholtz @minuscorp for feedback, really appreciate it!

The deployment target is set to iOS 12 because that's what Xcode recommended. I can change it to some lower version, like iOS 9. However anything below iOS 9 is just... ridiculous 🙃

I'd not touch the Objective-C code since there is so much point of rewriting that part other than just getting rid of Objective-C for the sake of it.

I'd like to keep the changes to Fastline and Snapfile as proposed since that would be perfectly aligned to documentation.

@joshdholtz joshdholtz merged commit 626fae3 into fastlane:master Jun 5, 2021
@minuscorp
Copy link
Collaborator

Just for the record, in the fastlane Swift project we support down to Swift 4 settings, that's why I was afraid of bumping so much from Swift 3 (that we all know is deprecated), to avoid misalignment from the main project. Just as the SPM support stablishes as well, but we'd need to downgrade Xcode to a Swift 4 release and make the same changes that have been merged here.

@crazymanish
Copy link
Member

Hi,
This PR got merged into master without running Unit-tests on CI 😉 (maybe because this was @bdolewski first PR...)
Fixed the broken CI in this PR: #18811

Thank you!

@bdolewski
Copy link
Contributor Author

Hi,
This PR got merged into master without running Unit-tests on CI 😉 (maybe because this was @bdolewski first PR...)
Fixed the broken CI in this PR: #18811

Thank you!

Thanks, yes - that was my 1st PR :) Did I miss something then?

@crazymanish
Copy link
Member

Hi,
This PR got merged into master without running Unit-tests on CI 😉 (maybe because this was @bdolewski first PR...)
Fixed the broken CI in this PR: #18811
Thank you!

Thanks, yes - that was my 1st PR :) Did I miss something then?

Ahhh...no you did not miss anything but CI did not run unit-tests for this PR, CircleCI don't run unit-tests for 1st PR (maybe because of security issue 🤷‍♂️)

Fastlane CI is running unit-tests with the old Xcode version too i.e Xcode 10.2.1, which does not support iPhone 12 Pro Max simulator added in this PR example snapfile 😉
btw, Nothing to worry about...fixed the broken CI in this PR: #18811 😇
Enjoy your weekend!

Copy link

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

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

Congratulations! 🎉 This was released as part of fastlane 2.185.0 🚀

@fastlane fastlane locked and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants