yonaskolb / yonaskolb/XcodeGen
2.42.0 bug: The element XCLocalSwiftPackageReference is not supported when generating mocks with Mockingbird
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 8.8k
- Forks
- 908
- Avg merge
- 17d 14h
- Merged PRs (30d)
- 2
Description
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!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported version change from XcodeGen 2.42.0 and inspect the project.yml dependency configuration and bin/mockingbird.sh generation command. Reproduce the unsupported XCLocalSwiftPackageReference error with the stated Xcode and macOS versions, then verify that generated projects support the Mockingbird setup without that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100