-
Notifications
You must be signed in to change notification settings - Fork 429
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
Skip building testing libraries for SPM users. #758
Skip building testing libraries for SPM users. #758
Conversation
Hmm seems like only one test didn't pass on one environment (exceeding 1 sec) - is this something it was there before? |
A side effect introduced by this change is that you can no longer open the Package.swift in Xcode 11 and run the tests from there. 🤔 |
I assume (or believe) Quick and Nimble are only built when running |
@ikesyo yeah that's what I assumed as well but you can try it yourself by creating a new Xcode 11 project with SwiftUI & add ReactiveSwift as an SPM package and test. First, you will see all the dependencies in the project navigator (e.g. Quick, Nimble and their dependencies - maybe for resolution). But then you will see that Xcode Previews will try to actually build it and fail - so once you import ReactiveSwift into your project then you won't be able to use Xcode Previews. Additionally I saw reports (and had it happened to me to) that it will actually crash on runtime with a Of course you could ignore it and rely on Xcode/SPM fixing it but I think this is worth looking into this PR as a short-term solution until its fixed. The drawback is that you will need to do one additional step in the development process. |
@ikesyo I was talking about Xcode Previews, these are available when you open a canvas (option+cmd+enter) in a SwiftUI-compatible view: struct Test: View {
var body: some View {
Text("test")
}
}
#if DEBUG
struct Test_Previews : PreviewProvider {
static var previews: some View {
Group {
Test()
}
}
}
#endif
|
I don't have Catalina environment yet so I can't examine it locally. |
@ikesyo alright, no worries. We are maintaining our own fork for that matter at Moya for now if anyone is interested as well. |
@ikesyo I just found an alternative approach to that problem - using Rocket for the release process, which can remove testing dependencies just for the release tag. Do you think we should consider this approach instead? RxSwiftCommunity/RxOptional#83 |
Closed in favor of #784 |
Hey all! In this PR I'm removing testing libraries for SPM users. This is because currently SPM will both fetch & build your libraries even though they are in a target that you don't use. Because of that (and the current integration of SPM in Xcode), Xcode will build your testing dependencies (either in Xcode Preview or for normal builds) and complain (in Preview you won't ever get your UI to show and in your projects you will get runtime crash for missing XCTest etc.).
With this fix we are still able to test ReactiveSwift (using additional env variable) and skip downloading the testing libraries for normal usage.
Let me know what you think about it.
Checklist