-
Notifications
You must be signed in to change notification settings - Fork 69
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 Swift Package Manager #47
Conversation
Awesome looks like CI is happy. Care to take a look when you're not busy @NickEntin? 🙏 Thanks! I can also update some docs once you're happy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! Just a few small comments plus adding install instructions to the README, and I think this should be good to go
Sources/AccessibilitySnapshot/SnapshotTesting/SnapshotTesting+Accessibility.swift
Outdated
Show resolved
Hide resolved
Oh, we should also add a CI build for this. I pushed a commit to add the CI build, but I'm getting errors when I run it locally. |
Co-authored-by: Nick Entin <[email protected]>
Done some basic docs - just need to get the CI build working 👍 |
Pushed up one change which seems to make it a lot happier than it was... I'm also trying to run the build via the Swift command itself running:
but it seems to be freaking out on the lack of UIKit. All very peculiar because in a normal project it runs absolutely fine! One idea might be to setup an actual Xcode project which uses the library via a local dependency? If we can build/test that (add one basic example?) then it would prove what we need it to and circumvent the direct building stupidities? |
Spoke to someone at work who knows way more about Swift than me and he pointed me down the right track! tl;dr All working locally using iOS 14 |
Ahh, interesting! I didn't know that .target(
name: "AccessibilitySnapshotCore",
dependencies: ["AccessibilitySnapshotCore-ObjC"],
- path: "Sources/AccessibilitySnapshot/Core/Swift"
+ path: "Sources/AccessibilitySnapshot/Core/Swift",
+ resources: [.process("Assets")]
), The second set of errors is around undefined symbols in UIKit. That one I'm not sure about. Any idea why it wouldn't linking UIKit correctly when generating the Xcode project? Avoiding generating the Xcode project in CI seems reasonable, but we should make sure this isn't revealing some other underlying issue. |
@NickEntin from my understanding this is just a bug with the project that gets generated - a lot of the flags that are needed for an iOS target haven't been configured correctly (bare in mind that iOS support is relatively new to SPM!) I have tried this exhaustively in projects and haven't seen any problems - I'm pretty confident what we were seeing on CI was just an issue with the approach (and not something you'd do in a standard iOS project) |
I had (and can push it to the project if you'd like) made a completely separate CI iOS Xcode project which just showed that including the package normally and using it in a test worked absolutely fine. This might be another option if you're not confident with the current CI approach! |
Got it. As long as the test project was working for you, I think this should be fine. 👍 Just a couple small nits, and then I think we're good to merge! |
Co-authored-by: Nick Entin <[email protected]>
As I say the purpose of CI is to give us confidence -- more than happy to explore other changes and improvements. Or we can just wait for the first issue to be raised and discuss how wrong I am in there 😅 Nits all committed 🙌 Thanks Nick! |
Haha I think I'm pretty confident in this now. Just trying to double check everything as I go since I don't have a lot of context around SPM. I appreciate all the investigation you've done here! 🙌 As soon as this goes green, I'll merge the PR and enable the SPM Build job as a required check. Thanks for another great addition, James! 🎉 |
Supersedes #24
AccessibilitySnapshot
directory in favour of aSources
directory (which is closer to the Swift Package Manager expected format)Incomplete:
Tried to keep the changes as small as possible in this first merge request allowing us to iterate more easily!
Project builds correctly when opening the Swift Package (but no tests). Have also run
pod install
and then run the tests in the Example project and they're working fine for me. (Let's see how CI does!)@NickEntin - Let me know what you think on these changes 😄