Cuckoo
Cuckoo copied to clipboard
Cannot generate mock classes using tuist
CONTEXT
- I've just created a new sample iOS project with tuist by using the following command
tuist init. - Then I run
tuist editto see the Package.swift and Project.swift in order to add the Cuckoo 2.1.1 dependency to my test target. - After installing the dependencies with
tuist install. Everything looks good.
PROBLEMS
- I'm not able to add the
CuckooPluginSingleFileplugin to the build pahses of my test target. Because it doesn't appear, it's not detected. - I'm not able to generate the mocks even after adding my
Cuckoofile.toml. Because I do NOT know how to install cuckoo as a command line tool. According to the documentation, they only mention SPM and Cocoapods. Is there a way to run cuckoo from command line?
TOOLS
- Xcode: 26.0.1
- macOS: 15.6.1
- Simulator: iPhone 17 Pro iOS 26.0
- Cuckoo 2.1.1
- Tuist: 4.79.7
dependencies: [
.target(name: "SampleTuist"),
.package(product: "Cuckoo", type: .runtime),
.package(product: "CuckooPluginSingleFile", type: .plugin)
]
did the trick for me.
It does not generate mocks though. Documentation on the .toml file is lackluster, and the plugin won't run without it =(
That's an interesting use-case, I haven't tried integrating the library into a Tuist project. The mocks should get generated, just not at the output path you specify (SPM generates some tmp path). That is the unfortunate nature of sandboxed build plugins, but your mocks should be available.