From ade3ba4c6e3c4467005d2663f257325be07e6510 Mon Sep 17 00:00:00 2001 From: Max Kraev Date: Thu, 16 Jan 2025 13:49:49 +0100 Subject: [PATCH 1/2] 4.39.1 --- ProjectAutomation/Configuration.swift | 17 ++++++--------- ProjectAutomation/Graph.swift | 2 +- ProjectAutomation/Package.swift | 4 ++-- ProjectAutomation/Project.swift | 2 +- ProjectAutomation/Scheme.swift | 2 +- ProjectAutomation/Settings.swift | 2 +- ProjectAutomation/Target.swift | 2 +- ProjectAutomation/TargetDependency.swift | 27 +++++++++++++----------- ProjectAutomation/Task.swift | 12 +++++------ ProjectAutomation/Tuist.swift | 2 +- 10 files changed, 36 insertions(+), 36 deletions(-) diff --git a/ProjectAutomation/Configuration.swift b/ProjectAutomation/Configuration.swift index a3127dc..25e361e 100644 --- a/ProjectAutomation/Configuration.swift +++ b/ProjectAutomation/Configuration.swift @@ -2,10 +2,10 @@ import Foundation // MARK: - Configuration -// A the build Configuration of a target. +// The build Configuration of a target. public struct Configuration: Equatable, Codable { - let settings: SettingsDictionary + private let settings: SettingsDictionary public init( settings: SettingsDictionary @@ -16,19 +16,16 @@ public struct Configuration: Equatable, Codable { // MARK: - BuildConfiguration -public struct BuildConfiguration: Equatable, Codable, Hashable { - public enum Variant: String, Codable, Hashable { +public struct BuildConfiguration: Codable, Hashable { + public enum Variant: Codable { case debug case release } - public var name: String - public var variant: BuildConfiguration.Variant + private let name: String + private let variant: Variant - public init( - name: String, - variant: BuildConfiguration.Variant - ) { + public init(name: String, variant: Variant) { self.name = name self.variant = variant } 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..c408695 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) From 360d7c637a5d9c43e1b2791256ff6747f174f0a1 Mon Sep 17 00:00:00 2001 From: Max Kraev Date: Fri, 28 Mar 2025 11:33:52 +0100 Subject: [PATCH 2/2] 4.45.1 --- ProjectAutomation/Configuration.swift | 21 ++++++++++++--------- ProjectAutomation/Tuist.swift | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ProjectAutomation/Configuration.swift b/ProjectAutomation/Configuration.swift index 25e361e..2ab979a 100644 --- a/ProjectAutomation/Configuration.swift +++ b/ProjectAutomation/Configuration.swift @@ -2,10 +2,10 @@ import Foundation // MARK: - Configuration -// The build Configuration of a target. +// A the build Configuration of a target. -public struct Configuration: Equatable, Codable { - private let settings: SettingsDictionary +public struct Configuration: Equatable, Codable, Sendable { + let settings: SettingsDictionary public init( settings: SettingsDictionary @@ -16,16 +16,19 @@ public struct Configuration: Equatable, Codable { // MARK: - BuildConfiguration -public struct BuildConfiguration: Codable, Hashable { - public enum Variant: Codable { +public struct BuildConfiguration: Equatable, Codable, Hashable, Sendable { + public enum Variant: String, Codable, Hashable, Sendable { case debug case release } - private let name: String - private let variant: Variant + public var name: String + public var variant: BuildConfiguration.Variant - public init(name: String, variant: Variant) { + public init( + name: String, + variant: BuildConfiguration.Variant + ) { self.name = name self.variant = variant } @@ -33,7 +36,7 @@ public struct BuildConfiguration: 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/Tuist.swift b/ProjectAutomation/Tuist.swift index c408695..0d8a124 100644 --- a/ProjectAutomation/Tuist.swift +++ b/ProjectAutomation/Tuist.swift @@ -34,7 +34,7 @@ public enum Tuist { var arguments = [ "tuist", "graph", - "--format", "json", + "--format", "legacyJSON", "--output-path", temporaryDirectory.path, ] if let path {