yonaskolb / yonaskolb/XcodeGen

Conditional dependencies based on `xcodebuild` version

Open
#1,231 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
8.8k
Forks
908
Avg merge
17d 14h
Merged PRs (30d)
2

Description

I am trying to add App Intents to our app (not in an App Intents Extension, so it is not related to ). I am working with Xcode 14 beta while my colleagues are still working on Xcode 13 on the same project. There is an issue by Apple [FB10630607 - AppIntents framework linked on iOS 15 when using AppEntity/EntityQuery] that causes the app to crash on launch if compiled for iOS 15 from Xcode 14 because the app looks for AppIntents.framework, which is not present in iOS 15.5.

Apple suggested this workaround:

[...] you can manually add AppIntents.framework to your target’s “Link Binary With Libraries” Build Phases and explicitly set its status to Optional.

So I added

dependencies:
  - sdk: AppIntents.framework
    weak: true

to my XcodeGen configuration.

However, if I try to build the app with Xcode 13 as my colleagues will continue doing, I get Framework not found AppIntents error, that is solved my removing manually AppIntents.framework from Link Binary With Libraries.

I think this issue can be solved with a conditional statement in project spec file based on xcodebuild version. I am not sure, but maybe something like #1087.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start with the project spec file and the approach referenced in issue #1087, then trace how the dependencies entry is handled and how the xcodebuild version could participate in conditionals. Done means XcodeGen can include AppIntents.framework conditionally, while builds with Xcode 13 no longer fail with Framework not found AppIntents.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.