Cuckoo icon indicating copy to clipboard operation
Cuckoo copied to clipboard

Cannot generate mock classes using tuist

Open CarlitosDroid opened this issue 3 months ago • 2 comments

CONTEXT

  1. I've just created a new sample iOS project with tuist by using the following command tuist init.
  2. Then I run tuist edit to see the Package.swift and Project.swift in order to add the Cuckoo 2.1.1 dependency to my test target.
  3. After installing the dependencies with tuist install. Everything looks good.
Image Image Image

PROBLEMS

  1. I'm not able to add the CuckooPluginSingleFile plugin to the build pahses of my test target. Because it doesn't appear, it's not detected.
  2. 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?
Image Image Image

TOOLS

  • Xcode: 26.0.1
  • macOS: 15.6.1
  • Simulator: iPhone 17 Pro iOS 26.0
  • Cuckoo 2.1.1
  • Tuist: 4.79.7

CarlitosDroid avatar Sep 28 '25 20:09 CarlitosDroid

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 =(

iharandreyev avatar Nov 18 '25 15:11 iharandreyev

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.

MatyasKriz avatar Nov 24 '25 16:11 MatyasKriz