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

fix: XCFramework linking #6153

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions Sources/TuistCore/Graph/GraphDependencyReference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public enum GraphDependencyReference: Equatable, Comparable, Hashable {
switch self {
case let .framework(_, _, _, _, _, _, _, _, condition),
let .library(_, _, _, _, condition),
let .xcframework(_, _, _, _, _, condition),
let .xcframework(_, _, _, _, _, _, condition),
let .bundle(_, condition),
let .product(_, _, condition),
let .sdk(_, _, _, condition):
Expand All @@ -20,6 +20,7 @@ public enum GraphDependencyReference: Equatable, Comparable, Hashable {
case macro(path: AbsolutePath)
case xcframework(
path: AbsolutePath,
linking: BinaryLinking,
infoPlist: XCFrameworkInfoPlist,
primaryBinaryPath: AbsolutePath,
binaryPath: AbsolutePath,
Expand Down Expand Up @@ -73,6 +74,7 @@ public enum GraphDependencyReference: Equatable, Comparable, Hashable {
case let .xcframework(xcframework):
self = .xcframework(
path: xcframework.path,
linking: xcframework.linking,
Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gist

infoPlist: xcframework.infoPlist,
primaryBinaryPath: xcframework.primaryBinaryPath,
binaryPath: xcframework.primaryBinaryPath,
Expand All @@ -96,7 +98,7 @@ public enum GraphDependencyReference: Equatable, Comparable, Hashable {
return path
case let .library(path, _, _, _, _):
return path
case let .xcframework(path, _, _, _, _, _):
case let .xcframework(path, _, _, _, _, _, _):
return path
default:
return nil
Expand Down Expand Up @@ -124,6 +126,7 @@ public enum GraphDependencyReference: Equatable, Comparable, Hashable {
self = .macro(path: path)
case .xcframework(
path: let path,
linking: _,
infoPlist: _,
primaryBinaryPath: _,
binaryPath: _,
Expand Down
1 change: 1 addition & 0 deletions Sources/TuistCore/Graph/GraphTraverser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ public class GraphTraverser: GraphTraversing {
case let .xcframework(xcframework):
return .xcframework(
path: xcframework.path,
linking: xcframework.linking,
Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gist

infoPlist: xcframework.infoPlist,
primaryBinaryPath: xcframework.primaryBinaryPath,
binaryPath: xcframework.primaryBinaryPath,
Expand Down
6 changes: 3 additions & 3 deletions Sources/TuistGenerator/Generator/LinkGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ final class LinkGenerator: LinkGenerating { // swiftlint:disable:this type_body_
switch dependency {
case .framework:
frameworkReferences.append(dependency)
case let .xcframework(path, _, _, _, _, condition):
case let .xcframework(path, _, _, _, _, _, condition):
guard let fileRef = fileElements.file(path: path) else {
throw LinkGeneratorError.missingReference(path: path)
}
Expand Down Expand Up @@ -417,7 +417,7 @@ final class LinkGenerator: LinkGenerating { // swiftlint:disable:this type_body_
try addBuildFile(path, condition: condition, status: status)
case let .library(path, _, _, _, condition):
try addBuildFile(path, condition: condition)
case let .xcframework(path, _, _, _, status, condition):
case let .xcframework(path, _, _, _, _, status, condition):
try addBuildFile(path, condition: condition, status: status)
case .bundle, .macro:
break
Expand Down Expand Up @@ -559,7 +559,7 @@ final class LinkGenerator: LinkGenerating { // swiftlint:disable:this type_body_

for dependency in dependencies.sorted() {
switch dependency {
case let .xcframework(path: path, _, _, _, _, condition):
case let .xcframework(path: path, _, _, _, _, _, condition):
guard let fileRef = fileElements.file(path: path) else {
throw LinkGeneratorError.missingReference(path: path)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/TuistGenerator/Generator/ProjectFileElements.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class ProjectFileElements {
group: filesGroup,
sourceRootPath: sourceRootPath
)
case let .xcframework(path, _, _, _, _, _):
case let .xcframework(path, _, _, _, _, _, _):
try generatePrecompiledDependency(
path,
groups: groups,
Expand Down