Skip to content

Commit 529972c

Browse files
authored
chore: sendability conformance (#44)
* Sendability Conformance * Enable Strict Concurrency * Linting
1 parent f364d91 commit 529972c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+87
-82
lines changed

Package.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ var targets: [Target] = [
88
dependencies: [
99
"AnyCodable",
1010
"Path",
11+
],
12+
swiftSettings: [
13+
.enableExperimentalFeature("StrictConcurrency"),
1114
]
1215
),
1316
]

Project.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import ProjectDescription
22
import ProjectDescriptionHelpers
33

4-
let baseSettings: SettingsDictionary = [:]
4+
let baseSettings: SettingsDictionary = [
5+
"SWIFT_STRICT_CONCURRENCY": "complete",
6+
]
57

68
func debugSettings() -> SettingsDictionary {
79
var settings = baseSettings

Sources/XcodeGraph/DependenciesGraph/DependenciesGraph.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import Path
33

44
/// A directed acyclic graph (DAG) that Tuist uses to represent the dependency tree.
5-
public struct DependenciesGraph: Equatable, Codable {
5+
public struct DependenciesGraph: Equatable, Codable, Sendable {
66
/// A dictionary where the keys are the supported platforms and the values are dictionaries where the keys are the names of
77
/// dependencies, and the values are the dependencies themselves.
88
public let externalDependencies: [String: [TargetDependency]]

Sources/XcodeGraph/Models/AnalyzeAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public struct AnalyzeAction: Equatable, Codable {
3+
public struct AnalyzeAction: Equatable, Codable, Sendable {
44
// MARK: - Attributes
55

66
public let configurationName: String

Sources/XcodeGraph/Models/ArchiveAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Path
33

4-
public struct ArchiveAction: Equatable, Codable {
4+
public struct ArchiveAction: Equatable, Codable, Sendable {
55
// MARK: - Attributes
66

77
public let configurationName: String

Sources/XcodeGraph/Models/Arguments.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

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

77
/// Launch arguments that are passed by the scheme when running a scheme action.

Sources/XcodeGraph/Models/BuildAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Path
33

4-
public struct BuildAction: Equatable, Codable {
4+
public struct BuildAction: Equatable, Codable, Sendable {
55
// MARK: - Attributes
66

77
public var targets: [TargetReference]

Sources/XcodeGraph/Models/BuildConfiguration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import Foundation
77
/// It hosts the name as well as the variant of
88
/// a configuration to help infer the appropriate
99
/// default settings.
10-
public struct BuildConfiguration: Codable {
11-
public enum Variant: String, Codable {
10+
public struct BuildConfiguration: Codable, Sendable {
11+
public enum Variant: String, Codable, Sendable {
1212
case debug, release
1313
}
1414

Sources/XcodeGraph/Models/BuildRule+CompilerSpec.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33
extension BuildRule {
44
/// Mapping of compiler specs supported by a build rule to Xcode's internal representation.
55
/// All values were coppied from `pbxproj`.
6-
public enum CompilerSpec: String, Codable {
6+
public enum CompilerSpec: String, Codable, Sendable {
77
case appIntentsMetadataExtractor = "com.apple.compilers.appintentsmetadata"
88
case appShortcutStringsMetadataExtractor = "com.apple.compilers.appshortcutstringsmetadata"
99
case appleClang = "com.apple.compilers.llvm.clang.1_0"

Sources/XcodeGraph/Models/BuildRule+FileType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33
extension BuildRule {
44
/// Mapping of file types supported by a build rule to Xcode's internal representation.
55
/// All values were coppied from `pbxproj`.
6-
public enum FileType: String, Codable {
6+
public enum FileType: String, Codable, Sendable {
77
case instrumentsPackageDefinition = "com.apple.instruments.package-definition"
88
case metalAIR = "compiled.air"
99
case machO = "compiled.mach-o"

Sources/XcodeGraph/Models/BuildRule.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

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

Sources/XcodeGraph/Models/CopyFileElement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Path
33

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

Sources/XcodeGraph/Models/CopyFilesAction.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Path
33

4-
public struct CopyFilesAction: Equatable, Codable {
4+
public struct CopyFilesAction: Equatable, Codable, Sendable {
55
/// Name of the build phase when the project gets generated.
66
public var name: String
77

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

1717
/// Destination path.
18-
public enum Destination: String, Equatable, Codable {
18+
public enum Destination: String, Equatable, Codable, Sendable {
1919
case absolutePath
2020
case productsDirectory
2121
case wrapper

Sources/XcodeGraph/Models/CoreDataModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import Path
33

44
/// Represents a Core Data model
5-
public struct CoreDataModel: Equatable, Codable {
5+
public struct CoreDataModel: Equatable, Codable, Sendable {
66
// MARK: - Attributes
77

88
/// Relative path to the Core Data model.

Sources/XcodeGraph/Models/DeploymentTargets.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22

33
// MARK: - DeploymentTargets
44

5-
public struct DeploymentTargets: Hashable, Codable {
5+
public struct DeploymentTargets: Hashable, Codable, Sendable {
66
public let iOS: String?
77
public let macOS: String?
88
public let watchOS: String?

Sources/XcodeGraph/Models/Destination.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import Foundation
33
public typealias Destinations = Set<Destination>
44

55
extension Destinations {
6-
public static var watchOS: Destinations = [.appleWatch]
7-
public static var iOS: Destinations = [.iPhone, .iPad, .macWithiPadDesign]
8-
public static var macOS: Destinations = [.mac]
9-
public static var tvOS: Destinations = [.appleTv]
10-
public static var visionOS: Destinations = [.appleVision]
6+
public static let watchOS: Destinations = [.appleWatch]
7+
public static let iOS: Destinations = [.iPhone, .iPad, .macWithiPadDesign]
8+
public static let macOS: Destinations = [.mac]
9+
public static let tvOS: Destinations = [.appleTv]
10+
public static let visionOS: Destinations = [.appleVision]
1111
}
1212

1313
extension Destinations {
@@ -18,7 +18,7 @@ extension Destinations {
1818
}
1919

2020
/// A supported platform representation.
21-
public enum Destination: String, Codable, Equatable, CaseIterable {
21+
public enum Destination: String, Codable, Equatable, CaseIterable, Sendable {
2222
case iPhone
2323
case iPad
2424
case mac

Sources/XcodeGraph/Models/EnvironmentVariable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

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

77
/// The value of the environment variable

Sources/XcodeGraph/Models/ExecutionAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import Path
33

44
/// A execution action
5-
public struct ExecutionAction: Equatable, Codable {
5+
public struct ExecutionAction: Equatable, Codable, Sendable {
66
// MARK: - Attributes
77

88
/// Name of a script.

Sources/XcodeGraph/Models/FileCodeGen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Foundation
77
/// - `project`: project codegen attribute `settings = {ATTRIBUTES = (project_codegen, )}`
88
/// - `disabled`: disabled codegen attribute `settings = {ATTRIBUTES = (no_codegen, )}`
99
///
10-
public enum FileCodeGen: String, Codable, Equatable {
10+
public enum FileCodeGen: String, Codable, Equatable, Sendable {
1111
case `public` = "codegen"
1212
case `private` = "private_codegen"
1313
case project = "project_codegen"

Sources/XcodeGraph/Models/FileElement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Path
33

4-
public enum FileElement: Equatable, Hashable, Codable {
4+
public enum FileElement: Equatable, Hashable, Codable, Sendable {
55
case file(path: AbsolutePath)
66
case folderReference(path: AbsolutePath)
77

Sources/XcodeGraph/Models/Headers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import Path
33

44
/// Headers
5-
public struct Headers: Equatable, Codable {
5+
public struct Headers: Equatable, Codable, Sendable {
66
// MARK: - Attributes
77

88
public let `public`: [AbsolutePath]

Sources/XcodeGraph/Models/IDETemplateMacros.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public struct IDETemplateMacros: Codable, Hashable {
3+
public struct IDETemplateMacros: Codable, Hashable, Sendable {
44
private enum CodingKeys: String, CodingKey {
55
case fileHeader = "FILEHEADER"
66
}

Sources/XcodeGraph/Models/LaunchArgument.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

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

77
/// The name of the launch argument
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public enum LaunchStyle: Codable {
3+
public enum LaunchStyle: Codable, Sendable {
44
case automatically
55
case waitForExecutableToBeLaunched
66
}

Sources/XcodeGraph/Models/MergedBinaryType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// Represents the different options to configure a target for mergeable libraries
22
///
33
/// https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-mergeable-libraries
4-
public enum MergedBinaryType: Equatable, Codable {
4+
public enum MergedBinaryType: Equatable, Codable, Sendable {
55
/// Target is never going to merge available dependencies
66
case disabled
77

Sources/XcodeGraph/Models/MetalOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public struct MetalOptions: Equatable, Codable {
3+
public struct MetalOptions: Equatable, Codable, Sendable {
44
public var apiValidation: Bool
55
public var shaderValidation: Bool
66
public var showGraphicsOverview: Bool

Sources/XcodeGraph/Models/OnDemandResourcesTags.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public struct OnDemandResourcesTags: Codable, Equatable {
1+
public struct OnDemandResourcesTags: Codable, Equatable, Sendable {
22
public let initialInstall: [String]?
33
public let prefetchOrder: [String]?
44

Sources/XcodeGraph/Models/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Path
33

4-
public enum Package: Equatable, Codable {
4+
public enum Package: Equatable, Codable, Sendable {
55
case remote(url: String, requirement: Requirement)
66
case local(path: AbsolutePath)
77
}

Sources/XcodeGraph/Models/PlatformCondition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Path
33

4-
public struct PlatformCondition: Codable, Hashable, Equatable, Comparable {
4+
public struct PlatformCondition: Codable, Hashable, Equatable, Comparable, Sendable {
55
public static func < (lhs: PlatformCondition, rhs: PlatformCondition) -> Bool {
66
lhs.platformFilters < rhs.platformFilters
77
}

Sources/XcodeGraph/Models/PlatformFilter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extension PlatformFilters: Comparable {
1212
/// Defines a set of platforms that can be used to limit where things
1313
/// like build files, resources, and dependencies are used.
1414
/// Context: https://github.com/tuist/tuist/pull/3152
15-
public enum PlatformFilter: Comparable, Hashable, Codable, CaseIterable {
15+
public enum PlatformFilter: Comparable, Hashable, Codable, CaseIterable, Sendable {
1616
case ios
1717
case macos
1818
case tvos

Sources/XcodeGraph/Models/Plist.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import Path
33

44
// MARK: - Plist
55

6-
public enum Plist {
6+
public enum Plist: Sendable {
77
case infoPlist(InfoPlist)
88
case entitlements(Entitlements)
99

10-
public indirect enum Value: Equatable, Codable {
10+
public indirect enum Value: Equatable, Codable, Sendable {
1111
case string(String)
1212
case integer(Int)
1313
case real(Double)
@@ -92,7 +92,7 @@ extension Dictionary where Value == Plist.Value {
9292

9393
// MARK: - InfoPlist
9494

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

@@ -129,7 +129,7 @@ extension InfoPlist: ExpressibleByStringLiteral {
129129

130130
// MARK: - Entitlements
131131

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

Sources/XcodeGraph/Models/PrivacyManifest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public struct PrivacyManifest: Codable, Equatable {
3+
public struct PrivacyManifest: Codable, Equatable, Sendable {
44
public var tracking: Bool
55

66
public var trackingDomains: [String]

Sources/XcodeGraph/Models/Product.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public enum Product: String, CustomStringConvertible, CaseIterable, Codable {
3+
public enum Product: String, CustomStringConvertible, CaseIterable, Codable, Sendable {
44
case app
55
case staticLibrary = "static_library"
66
case dynamicLibrary = "dynamic_library"

Sources/XcodeGraph/Models/ProfileAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Path
33

4-
public struct ProfileAction: Equatable, Codable {
4+
public struct ProfileAction: Equatable, Codable, Sendable {
55
// MARK: - Attributes
66

77
public let configurationName: String

Sources/XcodeGraph/Models/Project.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import Path
33

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

77
/// Path to the folder that contains the project manifest.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
22

3-
public enum ProjectGroup: Hashable, Codable {
3+
public enum ProjectGroup: Hashable, Codable, Sendable {
44
case group(name: String)
55
}

Sources/XcodeGraph/Models/ProjectOptions.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22

33
extension Project {
44
/// Additional options related to the `Project`
5-
public struct Options: Codable, Hashable {
5+
public struct Options: Codable, Hashable, Sendable {
66
/// Defines how to generate automatic schemes
77
public let automaticSchemesOptions: AutomaticSchemesOptions
88

@@ -38,9 +38,9 @@ extension Project {
3838

3939
extension Project.Options {
4040
/// The automatic schemes options
41-
public enum AutomaticSchemesOptions: Codable, Hashable {
41+
public enum AutomaticSchemesOptions: Codable, Hashable, Sendable {
4242
/// Defines how to group targets into scheme for autogenerated schemes
43-
public enum TargetSchemesGrouping: Codable, Hashable {
43+
public enum TargetSchemesGrouping: Codable, Hashable, Sendable {
4444
/// Generate a single scheme per project
4545
case singleScheme
4646

@@ -68,7 +68,7 @@ extension Project.Options {
6868
}
6969

7070
/// The text settings options
71-
public struct TextSettings: Codable, Hashable {
71+
public struct TextSettings: Codable, Hashable, Sendable {
7272
/// Whether tabs should be used instead of spaces
7373
public let usesTabs: Bool?
7474

0 commit comments

Comments
 (0)