Closed andlang closed 4 years ago
Same issue here. How did you manage to remove the SwiftyMockyCLI dependencies but still keep SwiftyMocky running for the tests?
Hi guys. I will look into that over the weekend. In general, I think the problem is that we used originally SPM for CLI tool, which of course would not work in test targets.
@pballart I still use the legacy way with sourcery and a yaml config (https://github.com/MakeAWishFoundation/SwiftyMocky/blob/master/guides/Legacy.md). Therefore I could remove all targets from Package.swift
except “SwiftyMocky”. But that was just a quick fix.
I've faced the same issue. As a workaround, I install SwiftyMocky runtime via Carthage and the SwiftyMockyCLI via Mint.
Since we want to be ready for SwiftUI ASAP, i will try to help @andrzejmichnia resolve this issue
For those using SPM I made a workaround by removing all things related to CLI from Package.swift
:
git@github.com:kzietek/SwiftyMocky.git
with branch NoCLI
. As a side effect, preview builds much faster.
I just tried it and it works fine! 🎉
Should be fixed in 4.0.0
I just updated SPM to the latest commit of SwiftyMocky and can confirm: SwiftUI-Preview works :-) Thank you!
I included SwiftyMocky (3.4.0) in my iOS project with the Swift Package Manager. When I try to build the SwiftUI preview, the build fails in the dependency ShellOut with “Class Process is unknown” (it’s only available in macOS) . It seems, that the preview wants to build all of the dependencies, no matter what platform is supported. I could only solve the issue in removing all of the dependencies (for the SwiftyMockyCLI).
Is it possible, to make two packages? One for SwiftyMocky and one for SwiftyMockyCLI? In that way, there wouldn’t be an issue with the SwiftUI preview.
Maybe it will also be solved with: https://github.com/apple/swift-evolution/blob/master/proposals/0273-swiftpm-conditional-target-dependencies.md