SRGSSR / srgletterbox-apple

The official SRG SSR media playback experience
https://srgssr.github.io/marketing/letterbox/
MIT License
14 stars 7 forks source link

Switch demonstration application dependency from Carthage to SPM #258

Closed pyby closed 2 years ago

pyby commented 2 years ago

Issue type

Feature request

Description of the problem

Since #257, the make setup builds all AppCenter frameworks, for iOS and tvOS platforms. it takes time, and not all libraries are needed (like no AppCenterAnalytics.

The idea is to switch to SPM dependency, as it's the dependency tool used for all SRG libraries.

The goal is to:

Environment information

pyby commented 2 years ago

Sadly, the Xcode UI option to filter platform in the general target tab, "Frameworks, Libraries, and Content" section is only use during the link build phases.

platform filter

When selected an Apple TV destination, Xcode tries to build AppCenterDistribute library. The build fails, as the target is not available for tvOS.

Swift 5.3 introduced the Package Manager Conditional Target Dependencies (SE-0273). It's only for dependencies. Xcode SPM integration seems to not have this optional option for a dependency per platform.

pyby commented 2 years ago

We got a workaround idea: create an empty local product, which create the optional dependency on AppCenterDistribute.

A AppCenterDistributeOptional library is proposed. Naming can be discussed. This workaround works.

Proposition is on feature/remove-carthage branch.