SwiftyMocky icon indicating copy to clipboard operation
SwiftyMocky copied to clipboard

RunPhase in Xcode project

Open kyzmitch opened this issue 2 years ago • 1 comments

Wasn't able to find how to integrate SwiftyMocky after installation using SPM in Issues or in documentation, also tried to find it on stackoverflow but with no luck.

Is it correct that after adding SwiftyMocky as swift package dependency to the xcode project it is necessary to add swiftymocky module to unit test target and then add a Run Script build phase like:

# To setup initial Mockfile
swiftymocky setup
# To generate mocks
swiftymocky generate

Could someone help figure out which path to use for swiftymocky executable if it was installed using SPM? Also, I noticed that after adding SwiftyMocky framework as a dependency to unit test target in Link Binary with libraries it can't be found in XCTestCase related unit test file if you use import

I didn't want to use CLI from brew or mint, because I see that binary is present already in SPM

kyzmitch avatar Oct 18 '22 10:10 kyzmitch

Seem to recall executing something like this:

/usr/bin/xcrun --sdk macosx swift package --allow-writing-to-package-directory sourcery-code-generation

markst avatar Apr 18 '23 02:04 markst