SwiftyMocky icon indicating copy to clipboard operation
SwiftyMocky copied to clipboard

Mock generation issue for framework + mock framework when using Carthage

Open mpdifran opened this issue 3 years ago • 0 comments

This seems somewhat related to #229 .

We have a framework that mocks out protocols internally in order to run its own tests, and a separate mock framework that contains mocks of the public protocols (so consumers of this framework can run tests).

Both the framework and the mock framework have Build Phases like this:

swiftymocky generate public_interface

Whenever we set up a new machine, Carthage will fail to build the mock framework. Our workaround is to manually run swiftymocky generate public_interface inside Carthage/Checkout/<framework>, then run carthage bootstrap again. All further carthage updates / bootstraps will succeed.

It should be noted that we're running carthage in the app that consumes this framework, not the framework itself.

Here's the output we see when it fails:

🌱 Cloning Sourcery 1.0.0
🌱 Resolving package
╔════════════════════════╗
║ SwiftyMocky CLI v4.0.1 ║
╚════════════════════════╝
Running at: /Users/hmalc/Faire/ios-retailer/Carthage/Checkouts/ios-FaireCommon
Using template from Carthage
Processing mock: public_interface ...
❌  Error: ShellOut encountered an error
Status code: 1
Message: "/private/var/folders/n4/vjk2dt252d1_myfgn0jhb6c00000gn/T/mint/github.com_krzysztofzablocki_Sourcery: error: manifest parse error(s):
<unknown>:0: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX'
<unknown>:0: error: unable to load standard library for target 'x86_64-apple-macosx10.10'
🌱 Encountered error during "swift package resolve". Use --verbose to see full output
🌱  Failed to resolve Sourcery 1.0.0 with SPM"
Output: "🌱 Cloning Sourcery 1.0.0
🌱 Resolving package"
** ARCHIVE FAILED **

mpdifran avatar Sep 24 '20 18:09 mpdifran