diff --git a/ProjectAutomation/Configuration.swift b/ProjectAutomation/Configuration.swift index a3127dc..2ab979a 100644 --- a/ProjectAutomation/Configuration.swift +++ b/ProjectAutomation/Configuration.swift @@ -4,7 +4,7 @@ import Foundation // A the build Configuration of a target. -public struct Configuration: Equatable, Codable { +public struct Configuration: Equatable, Codable, Sendable { let settings: SettingsDictionary public init( @@ -16,8 +16,8 @@ public struct Configuration: Equatable, Codable { // MARK: - BuildConfiguration -public struct BuildConfiguration: Equatable, Codable, Hashable { - public enum Variant: String, Codable, Hashable { +public struct BuildConfiguration: Equatable, Codable, Hashable, Sendable { + public enum Variant: String, Codable, Hashable, Sendable { case debug case release } @@ -36,7 +36,7 @@ public struct BuildConfiguration: Equatable, Codable, Hashable { public typealias SettingsDictionary = [String: SettingValue] -public enum SettingValue: Equatable, Codable { +public enum SettingValue: Equatable, Codable, Sendable { case string(value: String) case array(value: [String]) diff --git a/ProjectAutomation/Graph.swift b/ProjectAutomation/Graph.swift index 4dd5500..937aaf1 100644 --- a/ProjectAutomation/Graph.swift +++ b/ProjectAutomation/Graph.swift @@ -1,7 +1,7 @@ import Foundation /// The structure defining the output schema of the entire project graph. -public struct Graph: Codable, Equatable { +public struct Graph: Codable, Equatable, Sendable { /// The name of this graph. public let name: String diff --git a/ProjectAutomation/Package.swift b/ProjectAutomation/Package.swift index 944a616..086b4e3 100644 --- a/ProjectAutomation/Package.swift +++ b/ProjectAutomation/Package.swift @@ -1,9 +1,9 @@ import Foundation /// The structure defining the output schema of the Swift package. -public struct Package: Codable, Equatable { +public struct Package: Codable, Equatable, Sendable { /// The type of the Swift package. - public enum PackageKind: String, Codable { + public enum PackageKind: String, Codable, Sendable { case remote case local } diff --git a/ProjectAutomation/Project.swift b/ProjectAutomation/Project.swift index 1f7a37a..3cc536f 100644 --- a/ProjectAutomation/Project.swift +++ b/ProjectAutomation/Project.swift @@ -1,7 +1,7 @@ import Foundation /// The structure defining the output schema of a Xcode project. -public struct Project: Codable, Equatable { +public struct Project: Codable, Equatable, Sendable { /// The name of the project. public let name: String diff --git a/ProjectAutomation/Scheme.swift b/ProjectAutomation/Scheme.swift index e38f4c2..468e579 100644 --- a/ProjectAutomation/Scheme.swift +++ b/ProjectAutomation/Scheme.swift @@ -1,7 +1,7 @@ import Foundation /// The structure defining the output schema of an Xcode scheme. -public struct Scheme: Codable, Equatable { +public struct Scheme: Codable, Equatable, Sendable { /// The name of the scheme. public let name: String diff --git a/ProjectAutomation/Settings.swift b/ProjectAutomation/Settings.swift index 0d69382..c8ddf55 100644 --- a/ProjectAutomation/Settings.swift +++ b/ProjectAutomation/Settings.swift @@ -2,7 +2,7 @@ import Foundation // A group of settings configurations. -public struct Settings: Equatable, Codable { +public struct Settings: Equatable, Codable, Sendable { public var configurations: [ProjectAutomation.BuildConfiguration: ProjectAutomation.Configuration?] public init( diff --git a/ProjectAutomation/Target.swift b/ProjectAutomation/Target.swift index 44644ba..03424ff 100644 --- a/ProjectAutomation/Target.swift +++ b/ProjectAutomation/Target.swift @@ -1,7 +1,7 @@ import Foundation /// The structure defining the output schema of a target. -public struct Target: Codable, Equatable { +public struct Target: Codable, Equatable, Sendable { /// The name of the target. public let name: String diff --git a/ProjectAutomation/TargetDependency.swift b/ProjectAutomation/TargetDependency.swift index e980393..9a9006f 100644 --- a/ProjectAutomation/TargetDependency.swift +++ b/ProjectAutomation/TargetDependency.swift @@ -1,24 +1,27 @@ import Foundation -public enum FrameworkStatus: String, Codable { +public enum LinkingStatus: String, Codable, Sendable { case required case optional + case none } -public enum SDKStatus: String, Codable { - case required - case optional -} +@available(*, deprecated, renamed: "LinkingStatus") +typealias FrameworkStatus = LinkingStatus + +@available(*, deprecated, renamed: "LinkingStatus") +typealias SDKStatus = LinkingStatus -public enum TargetDependency: Equatable, Hashable, Codable { - case target(name: String) - case project(target: String, path: String) - case framework(path: String, status: FrameworkStatus) - case xcframework(path: String, status: FrameworkStatus) +public enum TargetDependency: Equatable, Hashable, Codable, Sendable { + case target(name: String, status: LinkingStatus) + case macro(name: String) + case project(target: String, path: String, status: LinkingStatus) + case framework(path: String, status: LinkingStatus) + case xcframework(path: String, status: LinkingStatus) case library(path: String, publicHeaders: String, swiftModuleMap: String?) - case package(product: String) + case package(product: String, embedded: Bool = false) case packagePlugin(product: String) case packageMacro(product: String) - case sdk(name: String, status: SDKStatus) + case sdk(name: String, status: LinkingStatus) case xctest } diff --git a/ProjectAutomation/Task.swift b/ProjectAutomation/Task.swift index 6a7659c..1fbc72a 100644 --- a/ProjectAutomation/Task.swift +++ b/ProjectAutomation/Task.swift @@ -1,16 +1,16 @@ import Foundation -public struct Task { +public struct Task: Sendable { public let options: [Option] - public let task: ([String: String]) throws -> Void + public let task: @Sendable ([String: String]) throws -> Void - public enum Option: Equatable { + public enum Option: Equatable, Sendable { case option(String) } public init( options: [Option] = [], - task: @escaping ([String: String]) throws -> Void + task: @Sendable @escaping ([String: String]) throws -> Void ) { self.options = options self.task = task @@ -19,10 +19,10 @@ public struct Task { } private func runIfNeeded() { - guard let taskCommandLineIndex = CommandLine.arguments.firstIndex(of: "--tuist-task"), + guard let taskCommandLineIndex = ProcessInfo.processInfo.arguments.firstIndex(of: "--tuist-task"), CommandLine.argc > taskCommandLineIndex else { return } - let attributesString = CommandLine.arguments[taskCommandLineIndex + 1] + let attributesString = ProcessInfo.processInfo.arguments[taskCommandLineIndex + 1] // swiftlint:disable force_try let attributes: [String: String] = try! JSONDecoder().decode( [String: String].self, diff --git a/ProjectAutomation/Tuist.swift b/ProjectAutomation/Tuist.swift index 77f9059..0d8a124 100644 --- a/ProjectAutomation/Tuist.swift +++ b/ProjectAutomation/Tuist.swift @@ -2,7 +2,7 @@ import Foundation /// Tuist includes all methods to interact with your tuist project public enum Tuist { - enum TuistError: Error { + enum TuistError: Error, Sendable { case signalled(command: String, code: Int32, standardError: Data) case terminated(command: String, code: Int32, standardError: Data) @@ -34,7 +34,7 @@ public enum Tuist { var arguments = [ "tuist", "graph", - "--format", "json", + "--format", "legacyJSON", "--output-path", temporaryDirectory.path, ] if let path {