giginet / Scipio

A new build tool to generate XCFramework

Home Page:https://giginet.github.io/Scipio/documentation/scipio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Distributing generated xcframeworks

tcollins590 opened this issue · comments

I've successfully used scipio to generate the xcframework for my package. It's also generated an xcframework for each of the 5 dependencies I have in my project.

My questions are:

  1. Are the dependencies baked into my main target's xcframework? Or do all of the dependency xcframeworks need to be imported into a consuming project?
  2. Best way to distribute my package? Shall I create another package which will be a public repo that imports my xcframework as a binary? Do I also need to import each generated xcframework as a binary target, or since these are all third party, would adding them as a regular package dependency work?

Appreciate any guidance. Once I understand this a bit better I'm happy to help out on docs to improve examples.

@tcollins590
Sorry for waiting for you.

Q1.

No. Each XCFramework has symbols for each target. These are not combined. So you need to link to all dependent XCFrameworks.

Q2.

Do you mean you want to distribute XCFramework built with Scipio?

If you can publish the source code, I recommend distributing it as a regular Swift package and leaving the integration method to the user.

If you want to publish it as a prebuilt binary, it's better to publish as a binary package.
Prepare your XCFramework and publish it with binaryTarget in Package.swift
https://developer.apple.com/documentation/xcode/distributing-binary-frameworks-as-swift-packages

At this time, consider Library Evolution when preparing XCFramework with Scipio.

As we said in the documentation, LE is disabled by default in Scipio, making it unable to keep ABI compatibility.
You can build it in a suitable format for distribution by passing the -enable-library-evolution option.
https://giginet.github.io/Scipio/documentation/scipio/create-frameworks#Enable-Library-Evolution