yonaskolb / yonaskolb/XcodeGen
Reference Swift Package target as scheme build/target
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 8.8k
- Forks
- 908
- Avg merge
- 17d 14h
- Merged PRs (30d)
- 2
Description
Hi there,
I'm currently working on creating a scheme for a Swift package using XcodeGen, and I've run into a bit of a dilemma. The Swift package generates a target, but I'm having trouble incorporating it into the scheme through the project.yml file.
Here's a snippet of my code for better context:
.target(
name: "UIKitComponents",
dependencies: ["UIKitTheme"],
resources: []
),
Currently, I can create a target(throught XcodeGen) with the path of my Swift package and then use this target when creating the scheme in project.yml. However, this results in having two targets for the same Swift package in Xcode:
- One under the project, which I created with XcodeGen and can be referenced in the scheme creation.
- Another one under the package, which is created by Xcode/Package configs.
I have two questions:
- Is there a way to reference the target created by package in my
project.ymlfile when creating schemes, like the example below?
schemes:
UIKitComponents:
build:
targets:
UIKitV2/UIKitComponents: all
- If referencing the package/target in the
project.ymlfile is not possible, what would be the best approach to avoid ending up with two targets for the same Swift package?
Any guidance or suggestions would be greatly appreciated. Thank you!
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 project.yml scheme build targets and the Swift package target declaration shown in the issue. Compare how XcodeGen represents package-generated targets with generated project targets, and check whether the requested UIKitV2/UIKitComponents reference can avoid duplication. Done means documenting a supported configuration or the recommended approach for avoiding the duplicate target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift, yaml
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100