2.42.0 bug: The element XCLocalSwiftPackageReference is not supported when generating mocks with Mockingbird
I have the following problem.
I am using Mockingbird (https://github.com/typealiased/mockingbird) for mocking.
When i am building my test target, i get an error in my generate mockingbird mocks custom shell script.
The script is the following:
set -eu
# Prevent Xcode 13 from running this script while indexing.
[[ "${ACTION}" == "indexbuild" ]] && exit 0
# Infer the derived data location from the build environment.
[[ -z "${DERIVED_DATA+x}" ]] && DERIVED_DATA="$(echo "${BUILD_ROOT}" | sed -n 's|\(.*\)/Build/.*|\1|p')"
"${DERIVED_DATA}/SourcePackages/checkouts/mockingbird/mockingbird" generate --targets "develop" "developTests"
In my project.yml i have the following target:
developTests:
type: bundle.unit-test
platform: iOS
settings:
dependencies:
- target: develop
- package: Mockingbird
sources:
- path: appTests
- path: MockingbirdMocks
optional: true
preBuildScripts:
- path: ./bin/mockingbird.sh
name: Generate Mockingbird Mocks
outputFiles:
- $(SRCROOT)/MockingbirdMocks/developMocks.generated.swift
- $(SRCROOT)/MockingbirdMocks/developTestsMocks.generated.swift
basedOnDependencyAnalysis: false
The problem started when update xcodegen to 2.42.0.
I am using MacOS Sequoia 15, and XCode 16.0.0
Any help would be highly appreciated. Thanks in advance!
Hello, good afternoon. Is your problem still ongoing?
Try:
Check the Dependencies: Make sure all dependencies are installed correctly. You can try running the following command in the terminal to ensure that Mockingbird is updated: "swift package update".
Review the Script: Check if the path of Mockingbird in your script is correct. It should point to the correct location of the Mockingbird executable. The command in your script is: "${DERIVED_DATA}/SourcePackages/checkouts/mockingbird/mockingbird generate --targets develop developTests".
Make sure that the directory "SourcePackages/checkouts/mockingbird" actually contains the executable "mockingbird". You can use a command like "ls" to check this: "ls ${DERIVED_DATA}/SourcePackages/checkouts/mockingbird".
Check the Version of Mockingbird: Sometimes, dependency versions can cause issues. Check if the version of Mockingbird you are using is compatible with Xcode version 16.0.0. Refer to the Mockingbird documentation to verify the supported versions.
@victorsaccucci Hello and sorry for the late reply, i was away. Problem is still happening. Everything was working before i upgrade xcodegen to 2.42.0, so i don't know if i should start changing things regarding Mockingbird etc.
Do you have any ideas what changes in the latest xcodegen version could have introduced this issue?
@victorsaccucci I am trying to bring this issue back to life.
We are trying to upgrade ourxcodegen version but we're stuck because of this bug.