Skip to content

chore: sendability conformance #44

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

Merged
merged 3 commits into from
Sep 16, 2024
Merged
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
3 changes: 3 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ var targets: [Target] = [
dependencies: [
"AnyCodable",
"Path",
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency"),
]
),
]
Expand Down
4 changes: 3 additions & 1 deletion Project.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import ProjectDescription
import ProjectDescriptionHelpers

let baseSettings: SettingsDictionary = [:]
let baseSettings: SettingsDictionary = [
"SWIFT_STRICT_CONCURRENCY": "complete",
]

func debugSettings() -> SettingsDictionary {
var settings = baseSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import Path

/// A directed acyclic graph (DAG) that Tuist uses to represent the dependency tree.
public struct DependenciesGraph: Equatable, Codable {
public struct DependenciesGraph: Equatable, Codable, Sendable {
/// A dictionary where the keys are the supported platforms and the values are dictionaries where the keys are the names of
/// dependencies, and the values are the dependencies themselves.
public let externalDependencies: [String: [TargetDependency]]
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/AnalyzeAction.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct AnalyzeAction: Equatable, Codable {
public struct AnalyzeAction: Equatable, Codable, Sendable {
// MARK: - Attributes

public let configurationName: String
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/ArchiveAction.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Path

public struct ArchiveAction: Equatable, Codable {
public struct ArchiveAction: Equatable, Codable, Sendable {
// MARK: - Attributes

public let configurationName: String
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/Arguments.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

/// Arguments contain commandline arguments passed on launch and Environment variables.
public struct Arguments: Codable {
public struct Arguments: Codable, Sendable {
// MARK: - Attributes

/// Launch arguments that are passed by the scheme when running a scheme action.
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/BuildAction.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Path

public struct BuildAction: Equatable, Codable {
public struct BuildAction: Equatable, Codable, Sendable {
// MARK: - Attributes

public var targets: [TargetReference]
Expand Down
4 changes: 2 additions & 2 deletions Sources/XcodeGraph/Models/BuildConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Foundation
/// It hosts the name as well as the variant of
/// a configuration to help infer the appropriate
/// default settings.
public struct BuildConfiguration: Codable {
public enum Variant: String, Codable {
public struct BuildConfiguration: Codable, Sendable {
public enum Variant: String, Codable, Sendable {
case debug, release
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/BuildRule+CompilerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
extension BuildRule {
/// Mapping of compiler specs supported by a build rule to Xcode's internal representation.
/// All values were coppied from `pbxproj`.
public enum CompilerSpec: String, Codable {
public enum CompilerSpec: String, Codable, Sendable {
case appIntentsMetadataExtractor = "com.apple.compilers.appintentsmetadata"
case appShortcutStringsMetadataExtractor = "com.apple.compilers.appshortcutstringsmetadata"
case appleClang = "com.apple.compilers.llvm.clang.1_0"
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/BuildRule+FileType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
extension BuildRule {
/// Mapping of file types supported by a build rule to Xcode's internal representation.
/// All values were coppied from `pbxproj`.
public enum FileType: String, Codable {
public enum FileType: String, Codable, Sendable {
case instrumentsPackageDefinition = "com.apple.instruments.package-definition"
case metalAIR = "compiled.air"
case machO = "compiled.mach-o"
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/BuildRule.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

/// A BuildRule is used to specify a method for transforming an input file in to an output file(s).
public struct BuildRule: Codable, Equatable {
public struct BuildRule: Codable, Equatable, Sendable {
/// Element compiler spec.
public let compilerSpec: CompilerSpec

Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/CopyFileElement.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Path

public enum CopyFileElement: Equatable, Hashable, Codable {
public enum CopyFileElement: Equatable, Hashable, Codable, Sendable {
case file(path: AbsolutePath, condition: PlatformCondition? = nil, codeSignOnCopy: Bool = false)
case folderReference(path: AbsolutePath, condition: PlatformCondition? = nil, codeSignOnCopy: Bool = false)

Expand Down
4 changes: 2 additions & 2 deletions Sources/XcodeGraph/Models/CopyFilesAction.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Path

public struct CopyFilesAction: Equatable, Codable {
public struct CopyFilesAction: Equatable, Codable, Sendable {
/// Name of the build phase when the project gets generated.
public var name: String

Expand All @@ -15,7 +15,7 @@ public struct CopyFilesAction: Equatable, Codable {
public var files: [CopyFileElement]

/// Destination path.
public enum Destination: String, Equatable, Codable {
public enum Destination: String, Equatable, Codable, Sendable {
case absolutePath
case productsDirectory
case wrapper
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/CoreDataModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import Path

/// Represents a Core Data model
public struct CoreDataModel: Equatable, Codable {
public struct CoreDataModel: Equatable, Codable, Sendable {
// MARK: - Attributes

/// Relative path to the Core Data model.
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/DeploymentTargets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation

// MARK: - DeploymentTargets

public struct DeploymentTargets: Hashable, Codable {
public struct DeploymentTargets: Hashable, Codable, Sendable {
public let iOS: String?
public let macOS: String?
public let watchOS: String?
Expand Down
12 changes: 6 additions & 6 deletions Sources/XcodeGraph/Models/Destination.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import Foundation
public typealias Destinations = Set<Destination>

extension Destinations {
public static var watchOS: Destinations = [.appleWatch]
public static var iOS: Destinations = [.iPhone, .iPad, .macWithiPadDesign]
public static var macOS: Destinations = [.mac]
public static var tvOS: Destinations = [.appleTv]
public static var visionOS: Destinations = [.appleVision]
public static let watchOS: Destinations = [.appleWatch]
public static let iOS: Destinations = [.iPhone, .iPad, .macWithiPadDesign]
public static let macOS: Destinations = [.mac]
public static let tvOS: Destinations = [.appleTv]
public static let visionOS: Destinations = [.appleVision]
}

extension Destinations {
Expand All @@ -18,7 +18,7 @@ extension Destinations {
}

/// A supported platform representation.
public enum Destination: String, Codable, Equatable, CaseIterable {
public enum Destination: String, Codable, Equatable, CaseIterable, Sendable {
case iPhone
case iPad
case mac
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/EnvironmentVariable.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

/// It represents an environment variable that is passed when running a scheme's action
public struct EnvironmentVariable: Equatable, Codable, Hashable, ExpressibleByStringLiteral {
public struct EnvironmentVariable: Equatable, Codable, Hashable, ExpressibleByStringLiteral, Sendable {
// MARK: - Attributes

/// The value of the environment variable
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/ExecutionAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import Path

/// A execution action
public struct ExecutionAction: Equatable, Codable {
public struct ExecutionAction: Equatable, Codable, Sendable {
// MARK: - Attributes

/// Name of a script.
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/FileCodeGen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Foundation
/// - `project`: project codegen attribute `settings = {ATTRIBUTES = (project_codegen, )}`
/// - `disabled`: disabled codegen attribute `settings = {ATTRIBUTES = (no_codegen, )}`
///
public enum FileCodeGen: String, Codable, Equatable {
public enum FileCodeGen: String, Codable, Equatable, Sendable {
case `public` = "codegen"
case `private` = "private_codegen"
case project = "project_codegen"
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/FileElement.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Path

public enum FileElement: Equatable, Hashable, Codable {
public enum FileElement: Equatable, Hashable, Codable, Sendable {
case file(path: AbsolutePath)
case folderReference(path: AbsolutePath)

Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/Headers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import Path

/// Headers
public struct Headers: Equatable, Codable {
public struct Headers: Equatable, Codable, Sendable {
// MARK: - Attributes

public let `public`: [AbsolutePath]
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/IDETemplateMacros.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct IDETemplateMacros: Codable, Hashable {
public struct IDETemplateMacros: Codable, Hashable, Sendable {
private enum CodingKeys: String, CodingKey {
case fileHeader = "FILEHEADER"
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/LaunchArgument.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

/// It represents an argument that is passed when running a scheme's action
public struct LaunchArgument: Equatable, Codable, Hashable {
public struct LaunchArgument: Equatable, Codable, Hashable, Sendable {
// MARK: - Attributes

/// The name of the launch argument
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/LaunchStyle.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public enum LaunchStyle: Codable {
public enum LaunchStyle: Codable, Sendable {
case automatically
case waitForExecutableToBeLaunched
}
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/MergedBinaryType.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Represents the different options to configure a target for mergeable libraries
///
/// https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-mergeable-libraries
public enum MergedBinaryType: Equatable, Codable {
public enum MergedBinaryType: Equatable, Codable, Sendable {
/// Target is never going to merge available dependencies
case disabled

Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/MetalOptions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct MetalOptions: Equatable, Codable {
public struct MetalOptions: Equatable, Codable, Sendable {
public var apiValidation: Bool
public var shaderValidation: Bool
public var showGraphicsOverview: Bool
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/OnDemandResourcesTags.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public struct OnDemandResourcesTags: Codable, Equatable {
public struct OnDemandResourcesTags: Codable, Equatable, Sendable {
public let initialInstall: [String]?
public let prefetchOrder: [String]?

Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/Package.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Path

public enum Package: Equatable, Codable {
public enum Package: Equatable, Codable, Sendable {
case remote(url: String, requirement: Requirement)
case local(path: AbsolutePath)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/PlatformCondition.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Path

public struct PlatformCondition: Codable, Hashable, Equatable, Comparable {
public struct PlatformCondition: Codable, Hashable, Equatable, Comparable, Sendable {
public static func < (lhs: PlatformCondition, rhs: PlatformCondition) -> Bool {
lhs.platformFilters < rhs.platformFilters
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/PlatformFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extension PlatformFilters: Comparable {
/// Defines a set of platforms that can be used to limit where things
/// like build files, resources, and dependencies are used.
/// Context: https://github.com/tuist/tuist/pull/3152
public enum PlatformFilter: Comparable, Hashable, Codable, CaseIterable {
public enum PlatformFilter: Comparable, Hashable, Codable, CaseIterable, Sendable {
case ios
case macos
case tvos
Expand Down
8 changes: 4 additions & 4 deletions Sources/XcodeGraph/Models/Plist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import Path

// MARK: - Plist

public enum Plist {
public enum Plist: Sendable {
case infoPlist(InfoPlist)
case entitlements(Entitlements)

public indirect enum Value: Equatable, Codable {
public indirect enum Value: Equatable, Codable, Sendable {
case string(String)
case integer(Int)
case real(Double)
Expand Down Expand Up @@ -92,7 +92,7 @@ extension Dictionary where Value == Plist.Value {

// MARK: - InfoPlist

public enum InfoPlist: Equatable, Codable {
public enum InfoPlist: Equatable, Codable, Sendable {
// Path to a user defined info.plist file (already exists on disk).
case file(path: AbsolutePath)

Expand Down Expand Up @@ -129,7 +129,7 @@ extension InfoPlist: ExpressibleByStringLiteral {

// MARK: - Entitlements

public enum Entitlements: Equatable, Codable {
public enum Entitlements: Equatable, Codable, Sendable {
// Path to a user defined .entitlements file (already exists on disk).
case file(path: AbsolutePath)

Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/PrivacyManifest.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public struct PrivacyManifest: Codable, Equatable {
public struct PrivacyManifest: Codable, Equatable, Sendable {
public var tracking: Bool

public var trackingDomains: [String]
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/Product.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public enum Product: String, CustomStringConvertible, CaseIterable, Codable {
public enum Product: String, CustomStringConvertible, CaseIterable, Codable, Sendable {
case app
case staticLibrary = "static_library"
case dynamicLibrary = "dynamic_library"
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/ProfileAction.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Path

public struct ProfileAction: Equatable, Codable {
public struct ProfileAction: Equatable, Codable, Sendable {
// MARK: - Attributes

public let configurationName: String
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/Project.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Path

public struct Project: Hashable, Equatable, CustomStringConvertible, CustomDebugStringConvertible, Codable {
public struct Project: Hashable, Equatable, CustomStringConvertible, CustomDebugStringConvertible, Codable, Sendable {
// MARK: - Attributes

/// Path to the folder that contains the project manifest.
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeGraph/Models/ProjectGroup.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation

public enum ProjectGroup: Hashable, Codable {
public enum ProjectGroup: Hashable, Codable, Sendable {
case group(name: String)
}
8 changes: 4 additions & 4 deletions Sources/XcodeGraph/Models/ProjectOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation

extension Project {
/// Additional options related to the `Project`
public struct Options: Codable, Hashable {
public struct Options: Codable, Hashable, Sendable {
/// Defines how to generate automatic schemes
public let automaticSchemesOptions: AutomaticSchemesOptions

Expand Down Expand Up @@ -38,9 +38,9 @@ extension Project {

extension Project.Options {
/// The automatic schemes options
public enum AutomaticSchemesOptions: Codable, Hashable {
public enum AutomaticSchemesOptions: Codable, Hashable, Sendable {
/// Defines how to group targets into scheme for autogenerated schemes
public enum TargetSchemesGrouping: Codable, Hashable {
public enum TargetSchemesGrouping: Codable, Hashable, Sendable {
/// Generate a single scheme per project
case singleScheme

Expand Down Expand Up @@ -68,7 +68,7 @@ extension Project.Options {
}

/// The text settings options
public struct TextSettings: Codable, Hashable {
public struct TextSettings: Codable, Hashable, Sendable {
/// Whether tabs should be used instead of spaces
public let usesTabs: Bool?

Expand Down
Loading
Loading