Cuckoo mock generation for Swift packages that works on any machine. No installation required, simply add the package to your Package.swift‘s dependencies:

      dependencies: [
        .package(url: "", from: "1.9.1"),
        .package(url: "", from: "1.0.0")

Once you’ve declared any new dependencies, simply ask SPM to resolve your dependencies and install them, and then re-generate the Xcode project:

$ swift package update

Using it as a (pre-)build tool

Adding CuckooPlugin as a prebuild tool will execute it and generate your mock classes before each build.

Add to Package.swift

After adding the dependency to your Package.swift, include the CuckooPlugin plugin in any targets for which you would like it to run.

  targets: [
            name: "YourTestTargetName",
            dependencies: ["YourTargetName", "Cuckoo"],
            plugins: [
                .plugin(name: "CuckooPlugin", package: "CuckooPlugin")

Add a Cuckoo config

Add a cuckoo.json file to your package. Take a look at the json configuration below as an example.

    "targetName": "CardGame",
    "inputDir": "/Sources/CardGame",
    "inputFiles": [
    "outputFile": "/Tests/CardGameTests/GeneratedMocks.swift"


View Github