Unfortunately, some libraries assume they would be static, but they don’t make that explicit in their
Package.swift
manifests.
I let them know via Slack about the issue. I guess it didn’t come up yet as the framework only recently got released as a standalone framework with this new name. And most people don’t support iOS 16 or end up with static frameworks via SPM.
Would you mind posting the exact steps you did to make that work for future reference?
Sure. I used PFSharing as alias, but this could be something else.
In Tuist/Package.swift
for:
The target setting for ComposableArchitecture
is only needed, if used. If just using swift-sharing
alone it’s not needed.
let packageSettings = PackageSettings(
targetSettings: [
"ComposableArchitecture": [
"OTHER_SWIFT_FLAGS": ["-module-alias", "Sharing=PFSharing"]
],
"Sharing": ["PRODUCT_NAME": "PFSharing"]
]
)
In Project.swift
for each target depending on Sharing add the setting to the manifest.
settings: .init().otherSwiftFlags(["-module-alias", "Sharing=PFSharing"]