Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ProjectAutomation/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
}
Expand All @@ -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])

Expand Down
2 changes: 1 addition & 1 deletion ProjectAutomation/Graph.swift
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions ProjectAutomation/Package.swift
Original file line number Diff line number Diff line change
@@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion ProjectAutomation/Project.swift
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion ProjectAutomation/Scheme.swift
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion ProjectAutomation/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion ProjectAutomation/Target.swift
Original file line number Diff line number Diff line change
@@ -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

Expand Down
27 changes: 15 additions & 12 deletions ProjectAutomation/TargetDependency.swift
Original file line number Diff line number Diff line change
@@ -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
}
12 changes: 6 additions & 6 deletions ProjectAutomation/Task.swift
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions ProjectAutomation/Tuist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -34,7 +34,7 @@ public enum Tuist {
var arguments = [
"tuist",
"graph",
"--format", "json",
"--format", "legacyJSON",
"--output-path", temporaryDirectory.path,
]
if let path {
Expand Down