Closed kelvinharron closed 1 year ago
SPM noob confirmed! 😆
The problem was when adding Cuckoo via SPM, I was adding it to the app project and not the tests explicitly. Resolved now!
I'm happy to create a PR to update the README to be explicit about this if that helps!
Hey @kelvinharron, a PR that would help make this clear for others in the README would definitely be appreciated if you're willing. 🙂 And good job on finding that out yourself!
I'm having the same issue, even if I'm adding it to the test target
@0x7067 if you create a new project and try to add cuckoo are you able to reproduce it? or is this when you try to add it to an existing projecT?
I'm having this issue adding Cuckoo to an existing project
Found out what was the issue: I had the GeneratedMocks.swift
file added to the app project's target and not the test target
Nice one, @0x7067 ! I think that would make a nice explicit addition to the project README! 😄
I agree! Will open a PR later with an edited README
Hi folks. We've used Cuckoo to great success in a previous project (with Cocoapods) and while spiking out a skeleton app for a new project, I've encountered a blocker in trying to set Cuckoo up with SPM.
The problem
After following the instructions for SPM -> Clean & Build, I get the following error lines.
Where the three failures are down to this
Steps to reproduce
To rule out our project being the cause, I was able to reproduce it entirely with a brand-new iOS project.
"${PODS_ROOT}/Cuckoo/run"
with"${PROJECT_DIR}/run" --download
Run Script
``` if [ $ACTION == "indexbuild" ]; then echo "Not running Cuckoo generator during indexing." exit 0 fi # Skip for preview builds if [ "${ENABLE_PREVIEWS}" = "YES" ]; then echo "Not running Cuckoo generator during preview builds." exit 0 fi # Define output file. Change "${PROJECT_DIR}/${PROJECT_NAME}Tests" to your test's root source folder, if it's not the default name. OUTPUT_FILE="${PROJECT_DIR}/${PROJECT_NAME}Tests/GeneratedMocks.swift" echo "Generated Mocks File = ${OUTPUT_FILE}" # Define input directory. Change "${PROJECT_DIR}/${PROJECT_NAME}" to your project's root source folder, if it's not the default name. INPUT_DIR="${PROJECT_DIR}/${PROJECT_NAME}" echo "Mocks Input Directory = ${INPUT_DIR}" # Generate mock files, include as many input files as you'd like to create mocks for. "${PROJECT_DIR}/run" --download generate --testable "${PROJECT_NAME}" \ --output "${OUTPUT_FILE}" \ "${INPUT_DIR}/ViewModel.swift" # ... and so forth, the last line should never end with a backslash # After running once, locate `GeneratedMocks.swift` and drag it into your Xcode test target group. ```Please let me know what I can do to get it working. Thanks!