Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to declare a Carthage built XCFramework dependency? #1006

Open
pouty18 opened this issue Jan 11, 2021 · 5 comments · May be fixed by #1020
Open

How to declare a Carthage built XCFramework dependency? #1006

pouty18 opened this issue Jan 11, 2021 · 5 comments · May be fixed by #1020

Comments

@pouty18
Copy link

pouty18 commented Jan 11, 2021

I'm preparing my project for the upcoming Carthage release, which will build dependencies as XCFrameworks. How do I properly indicate a dependency on an XCFramework in my project.yml project spec?

Second question: Is there a way to disable the carthage copy files script being automatically added:
If any applications contain carthage dependencies within itself or any dependent targets, a carthage copy files script is automatically added to the application containing all the relevant frameworks. A FRAMEWORK_SEARCH_PATHS setting is also automatically added

For context, in the upcoming carthage release, they indicate that you'll no longer need to include a run script to call carthage copy-frameworks, and including this would actually introduce breaking changes to the currently carthage update --use-xcframeworks flow.

@DrewKiino
Copy link

figured it out, since xcframeworks don't need Carthage's copy frameworks run script anymore, you can just reference them in the dependency target like so

targets:
  MyApp:
    dependencies:
      framework: "Carthage/Build/iOS/Alamofire.xcframework"

and then you're good to go.

@CraigSiemens
Copy link
Contributor

CraigSiemens commented Feb 1, 2021

Is there any plan to update the XcodeGen to allow carthage: Alamofire to find the XCFramework? The shorthand is still nice to avoid entering in the full path to the dependency. Especially now that Carthage has been released to support building XCFrameworks.

@yonaskolb yonaskolb linked a pull request Feb 15, 2021 that will close this issue
@yonaskolb
Copy link
Owner

I've put up a draft PR for this here #1020, if you'd like to test it

@yonaskolb
Copy link
Owner

Would appreciate some testing of this to make sure it works on your projects. You can use Mint to test it easily

mint run yonaskolb/xcodegen@carthage-xcframeworks xcodegen

@CraigSiemens
Copy link
Contributor

I replied to the PR that was linked the my results from testing it (#1020 (comment)) but I also wanted to reply here too.

One issue I've noticed with added an xcframework from carthage as a dependency when the project also has a framework target and an app target.

  • If added to the app using framework it works fine
  • If added to my framework target the app will fail to launch cause the xcframework wont be copied into the app. Previously the copy script from carthage was copying in the frameworks and stripping out symbols. Striping out the symbols is no longer needed, but copying the frameworks is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants