diff --git a/Package.swift b/Package.swift index 78281de0..8ca337f9 100644 --- a/Package.swift +++ b/Package.swift @@ -8,6 +8,9 @@ var targets: [Target] = [ dependencies: [ "AnyCodable", "Path", + ], + swiftSettings: [ + .enableExperimentalFeature("StrictConcurrency"), ] ), ] diff --git a/Project.swift b/Project.swift index b3b6513a..4b4cd374 100644 --- a/Project.swift +++ b/Project.swift @@ -1,7 +1,9 @@ import ProjectDescription import ProjectDescriptionHelpers -let baseSettings: SettingsDictionary = [:] +let baseSettings: SettingsDictionary = [ + "SWIFT_STRICT_CONCURRENCY": "complete", +] func debugSettings() -> SettingsDictionary { var settings = baseSettings diff --git a/Sources/XcodeGraph/DependenciesGraph/DependenciesGraph.swift b/Sources/XcodeGraph/DependenciesGraph/DependenciesGraph.swift index 929ef3df..62972a92 100644 --- a/Sources/XcodeGraph/DependenciesGraph/DependenciesGraph.swift +++ b/Sources/XcodeGraph/DependenciesGraph/DependenciesGraph.swift @@ -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]] diff --git a/Sources/XcodeGraph/Models/AnalyzeAction.swift b/Sources/XcodeGraph/Models/AnalyzeAction.swift index eb63012b..c0d5577c 100644 --- a/Sources/XcodeGraph/Models/AnalyzeAction.swift +++ b/Sources/XcodeGraph/Models/AnalyzeAction.swift @@ -1,6 +1,6 @@ import Foundation -public struct AnalyzeAction: Equatable, Codable { +public struct AnalyzeAction: Equatable, Codable, Sendable { // MARK: - Attributes public let configurationName: String diff --git a/Sources/XcodeGraph/Models/ArchiveAction.swift b/Sources/XcodeGraph/Models/ArchiveAction.swift index a7e1ba65..99dc55a4 100644 --- a/Sources/XcodeGraph/Models/ArchiveAction.swift +++ b/Sources/XcodeGraph/Models/ArchiveAction.swift @@ -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 diff --git a/Sources/XcodeGraph/Models/Arguments.swift b/Sources/XcodeGraph/Models/Arguments.swift index c9aac9e2..5b939098 100644 --- a/Sources/XcodeGraph/Models/Arguments.swift +++ b/Sources/XcodeGraph/Models/Arguments.swift @@ -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. diff --git a/Sources/XcodeGraph/Models/BuildAction.swift b/Sources/XcodeGraph/Models/BuildAction.swift index 161e0d2e..ea782d38 100644 --- a/Sources/XcodeGraph/Models/BuildAction.swift +++ b/Sources/XcodeGraph/Models/BuildAction.swift @@ -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] diff --git a/Sources/XcodeGraph/Models/BuildConfiguration.swift b/Sources/XcodeGraph/Models/BuildConfiguration.swift index b49438bb..d51cf636 100644 --- a/Sources/XcodeGraph/Models/BuildConfiguration.swift +++ b/Sources/XcodeGraph/Models/BuildConfiguration.swift @@ -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 } diff --git a/Sources/XcodeGraph/Models/BuildRule+CompilerSpec.swift b/Sources/XcodeGraph/Models/BuildRule+CompilerSpec.swift index e615f9d1..6098f6a2 100644 --- a/Sources/XcodeGraph/Models/BuildRule+CompilerSpec.swift +++ b/Sources/XcodeGraph/Models/BuildRule+CompilerSpec.swift @@ -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" diff --git a/Sources/XcodeGraph/Models/BuildRule+FileType.swift b/Sources/XcodeGraph/Models/BuildRule+FileType.swift index 3f6f957b..d0f888bf 100644 --- a/Sources/XcodeGraph/Models/BuildRule+FileType.swift +++ b/Sources/XcodeGraph/Models/BuildRule+FileType.swift @@ -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" diff --git a/Sources/XcodeGraph/Models/BuildRule.swift b/Sources/XcodeGraph/Models/BuildRule.swift index 7464b4e1..5dcc324f 100644 --- a/Sources/XcodeGraph/Models/BuildRule.swift +++ b/Sources/XcodeGraph/Models/BuildRule.swift @@ -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 diff --git a/Sources/XcodeGraph/Models/CopyFileElement.swift b/Sources/XcodeGraph/Models/CopyFileElement.swift index 649599e3..4c9451af 100644 --- a/Sources/XcodeGraph/Models/CopyFileElement.swift +++ b/Sources/XcodeGraph/Models/CopyFileElement.swift @@ -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) diff --git a/Sources/XcodeGraph/Models/CopyFilesAction.swift b/Sources/XcodeGraph/Models/CopyFilesAction.swift index d61b35d6..06ba1438 100644 --- a/Sources/XcodeGraph/Models/CopyFilesAction.swift +++ b/Sources/XcodeGraph/Models/CopyFilesAction.swift @@ -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 @@ -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 diff --git a/Sources/XcodeGraph/Models/CoreDataModel.swift b/Sources/XcodeGraph/Models/CoreDataModel.swift index b17b74e2..a8f111e3 100644 --- a/Sources/XcodeGraph/Models/CoreDataModel.swift +++ b/Sources/XcodeGraph/Models/CoreDataModel.swift @@ -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. diff --git a/Sources/XcodeGraph/Models/DeploymentTargets.swift b/Sources/XcodeGraph/Models/DeploymentTargets.swift index 54db36d7..191db89b 100644 --- a/Sources/XcodeGraph/Models/DeploymentTargets.swift +++ b/Sources/XcodeGraph/Models/DeploymentTargets.swift @@ -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? diff --git a/Sources/XcodeGraph/Models/Destination.swift b/Sources/XcodeGraph/Models/Destination.swift index 0d7b2028..a7a30e73 100644 --- a/Sources/XcodeGraph/Models/Destination.swift +++ b/Sources/XcodeGraph/Models/Destination.swift @@ -3,11 +3,11 @@ import Foundation public typealias Destinations = Set 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 { @@ -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 diff --git a/Sources/XcodeGraph/Models/EnvironmentVariable.swift b/Sources/XcodeGraph/Models/EnvironmentVariable.swift index 9e40a70c..38f074e0 100644 --- a/Sources/XcodeGraph/Models/EnvironmentVariable.swift +++ b/Sources/XcodeGraph/Models/EnvironmentVariable.swift @@ -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 diff --git a/Sources/XcodeGraph/Models/ExecutionAction.swift b/Sources/XcodeGraph/Models/ExecutionAction.swift index 5c1f9737..1b1a798c 100644 --- a/Sources/XcodeGraph/Models/ExecutionAction.swift +++ b/Sources/XcodeGraph/Models/ExecutionAction.swift @@ -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. diff --git a/Sources/XcodeGraph/Models/FileCodeGen.swift b/Sources/XcodeGraph/Models/FileCodeGen.swift index e947f212..2fe3c599 100644 --- a/Sources/XcodeGraph/Models/FileCodeGen.swift +++ b/Sources/XcodeGraph/Models/FileCodeGen.swift @@ -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" diff --git a/Sources/XcodeGraph/Models/FileElement.swift b/Sources/XcodeGraph/Models/FileElement.swift index f7fe0379..1972e9e3 100644 --- a/Sources/XcodeGraph/Models/FileElement.swift +++ b/Sources/XcodeGraph/Models/FileElement.swift @@ -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) diff --git a/Sources/XcodeGraph/Models/Headers.swift b/Sources/XcodeGraph/Models/Headers.swift index 1a4c4dac..98fa08d0 100644 --- a/Sources/XcodeGraph/Models/Headers.swift +++ b/Sources/XcodeGraph/Models/Headers.swift @@ -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] diff --git a/Sources/XcodeGraph/Models/IDETemplateMacros.swift b/Sources/XcodeGraph/Models/IDETemplateMacros.swift index 3c4df637..28067ffa 100644 --- a/Sources/XcodeGraph/Models/IDETemplateMacros.swift +++ b/Sources/XcodeGraph/Models/IDETemplateMacros.swift @@ -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" } diff --git a/Sources/XcodeGraph/Models/LaunchArgument.swift b/Sources/XcodeGraph/Models/LaunchArgument.swift index 8ad8d697..7b204d97 100644 --- a/Sources/XcodeGraph/Models/LaunchArgument.swift +++ b/Sources/XcodeGraph/Models/LaunchArgument.swift @@ -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 diff --git a/Sources/XcodeGraph/Models/LaunchStyle.swift b/Sources/XcodeGraph/Models/LaunchStyle.swift index 93e06b7c..ed054918 100644 --- a/Sources/XcodeGraph/Models/LaunchStyle.swift +++ b/Sources/XcodeGraph/Models/LaunchStyle.swift @@ -1,6 +1,6 @@ import Foundation -public enum LaunchStyle: Codable { +public enum LaunchStyle: Codable, Sendable { case automatically case waitForExecutableToBeLaunched } diff --git a/Sources/XcodeGraph/Models/MergedBinaryType.swift b/Sources/XcodeGraph/Models/MergedBinaryType.swift index 2de57535..9d3c0cc5 100644 --- a/Sources/XcodeGraph/Models/MergedBinaryType.swift +++ b/Sources/XcodeGraph/Models/MergedBinaryType.swift @@ -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 diff --git a/Sources/XcodeGraph/Models/MetalOptions.swift b/Sources/XcodeGraph/Models/MetalOptions.swift index 8d859085..6c199072 100644 --- a/Sources/XcodeGraph/Models/MetalOptions.swift +++ b/Sources/XcodeGraph/Models/MetalOptions.swift @@ -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 diff --git a/Sources/XcodeGraph/Models/OnDemandResourcesTags.swift b/Sources/XcodeGraph/Models/OnDemandResourcesTags.swift index 75da69d1..a7c0b6ce 100644 --- a/Sources/XcodeGraph/Models/OnDemandResourcesTags.swift +++ b/Sources/XcodeGraph/Models/OnDemandResourcesTags.swift @@ -1,4 +1,4 @@ -public struct OnDemandResourcesTags: Codable, Equatable { +public struct OnDemandResourcesTags: Codable, Equatable, Sendable { public let initialInstall: [String]? public let prefetchOrder: [String]? diff --git a/Sources/XcodeGraph/Models/Package.swift b/Sources/XcodeGraph/Models/Package.swift index ac4aab84..c3811fdc 100644 --- a/Sources/XcodeGraph/Models/Package.swift +++ b/Sources/XcodeGraph/Models/Package.swift @@ -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) } diff --git a/Sources/XcodeGraph/Models/PlatformCondition.swift b/Sources/XcodeGraph/Models/PlatformCondition.swift index 442f28f1..64e1847a 100644 --- a/Sources/XcodeGraph/Models/PlatformCondition.swift +++ b/Sources/XcodeGraph/Models/PlatformCondition.swift @@ -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 } diff --git a/Sources/XcodeGraph/Models/PlatformFilter.swift b/Sources/XcodeGraph/Models/PlatformFilter.swift index 00f2b2ed..a7bff439 100644 --- a/Sources/XcodeGraph/Models/PlatformFilter.swift +++ b/Sources/XcodeGraph/Models/PlatformFilter.swift @@ -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 diff --git a/Sources/XcodeGraph/Models/Plist.swift b/Sources/XcodeGraph/Models/Plist.swift index 1ac2ff82..5f1d743b 100644 --- a/Sources/XcodeGraph/Models/Plist.swift +++ b/Sources/XcodeGraph/Models/Plist.swift @@ -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) @@ -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) @@ -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) diff --git a/Sources/XcodeGraph/Models/PrivacyManifest.swift b/Sources/XcodeGraph/Models/PrivacyManifest.swift index be1e2fc3..135bd58d 100644 --- a/Sources/XcodeGraph/Models/PrivacyManifest.swift +++ b/Sources/XcodeGraph/Models/PrivacyManifest.swift @@ -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] diff --git a/Sources/XcodeGraph/Models/Product.swift b/Sources/XcodeGraph/Models/Product.swift index 322a0683..d3876861 100644 --- a/Sources/XcodeGraph/Models/Product.swift +++ b/Sources/XcodeGraph/Models/Product.swift @@ -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" diff --git a/Sources/XcodeGraph/Models/ProfileAction.swift b/Sources/XcodeGraph/Models/ProfileAction.swift index d06c1435..1699b6df 100644 --- a/Sources/XcodeGraph/Models/ProfileAction.swift +++ b/Sources/XcodeGraph/Models/ProfileAction.swift @@ -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 diff --git a/Sources/XcodeGraph/Models/Project.swift b/Sources/XcodeGraph/Models/Project.swift index 2af8c99c..9ee70f60 100644 --- a/Sources/XcodeGraph/Models/Project.swift +++ b/Sources/XcodeGraph/Models/Project.swift @@ -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. diff --git a/Sources/XcodeGraph/Models/ProjectGroup.swift b/Sources/XcodeGraph/Models/ProjectGroup.swift index cebcdb1f..cea9a37e 100644 --- a/Sources/XcodeGraph/Models/ProjectGroup.swift +++ b/Sources/XcodeGraph/Models/ProjectGroup.swift @@ -1,5 +1,5 @@ import Foundation -public enum ProjectGroup: Hashable, Codable { +public enum ProjectGroup: Hashable, Codable, Sendable { case group(name: String) } diff --git a/Sources/XcodeGraph/Models/ProjectOptions.swift b/Sources/XcodeGraph/Models/ProjectOptions.swift index 219aae9c..c91c386e 100644 --- a/Sources/XcodeGraph/Models/ProjectOptions.swift +++ b/Sources/XcodeGraph/Models/ProjectOptions.swift @@ -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 @@ -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 @@ -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? diff --git a/Sources/XcodeGraph/Models/RawScriptBuildPhase.swift b/Sources/XcodeGraph/Models/RawScriptBuildPhase.swift index 808748f8..2555a244 100644 --- a/Sources/XcodeGraph/Models/RawScriptBuildPhase.swift +++ b/Sources/XcodeGraph/Models/RawScriptBuildPhase.swift @@ -2,7 +2,7 @@ import Foundation import Path /// It represents a raw script build phase. -public struct RawScriptBuildPhase: Equatable, Codable { +public struct RawScriptBuildPhase: Equatable, Codable, Sendable { /// The name of the build phase. public let name: String diff --git a/Sources/XcodeGraph/Models/Requirement.swift b/Sources/XcodeGraph/Models/Requirement.swift index 6b3852f3..1672ce62 100644 --- a/Sources/XcodeGraph/Models/Requirement.swift +++ b/Sources/XcodeGraph/Models/Requirement.swift @@ -1,6 +1,6 @@ import Foundation -public enum Requirement: Equatable, Codable { +public enum Requirement: Equatable, Codable, Sendable { case upToNextMajor(String) case upToNextMinor(String) case range(from: String, to: String) diff --git a/Sources/XcodeGraph/Models/ResourceFileElement.swift b/Sources/XcodeGraph/Models/ResourceFileElement.swift index 5023f01e..b221a255 100644 --- a/Sources/XcodeGraph/Models/ResourceFileElement.swift +++ b/Sources/XcodeGraph/Models/ResourceFileElement.swift @@ -1,7 +1,7 @@ import Foundation import Path -public enum ResourceFileElement: Equatable, Hashable, Codable { +public enum ResourceFileElement: Equatable, Hashable, Codable, Sendable { /// A file path (or glob pattern) to include, a list of file paths (or glob patterns) to exclude, ODR tags list and inclusion /// condition. /// For convenience, a string literal can be used as an alternate way to specify this option. diff --git a/Sources/XcodeGraph/Models/ResourceFileElements.swift b/Sources/XcodeGraph/Models/ResourceFileElements.swift index ec17e6fd..0ba59320 100644 --- a/Sources/XcodeGraph/Models/ResourceFileElements.swift +++ b/Sources/XcodeGraph/Models/ResourceFileElements.swift @@ -1,6 +1,6 @@ import Foundation -public struct ResourceFileElements: Codable, Equatable { +public struct ResourceFileElements: Codable, Equatable, Sendable { public var resources: [ResourceFileElement] public var privacyManifest: PrivacyManifest? diff --git a/Sources/XcodeGraph/Models/ResourceSynthesizer.swift b/Sources/XcodeGraph/Models/ResourceSynthesizer.swift index f1ce4edd..df5397b7 100644 --- a/Sources/XcodeGraph/Models/ResourceSynthesizer.swift +++ b/Sources/XcodeGraph/Models/ResourceSynthesizer.swift @@ -1,19 +1,19 @@ -import AnyCodable +@preconcurrency import AnyCodable import Foundation import Path -public struct ResourceSynthesizer: Equatable, Hashable, Codable { +public struct ResourceSynthesizer: Equatable, Hashable, Codable, Sendable { public let parser: Parser public let parserOptions: [String: Parser.Option] public let extensions: Set public let template: Template - public enum Template: Equatable, Hashable, Codable { + public enum Template: Equatable, Hashable, Codable, Sendable { case file(AbsolutePath) case defaultTemplate(String) } - public enum Parser: String, Equatable, Hashable, Codable { + public enum Parser: String, Equatable, Hashable, Codable, Sendable { case strings case assets case plists @@ -24,7 +24,7 @@ public struct ResourceSynthesizer: Equatable, Hashable, Codable { case yaml case files - public struct Option: Equatable, Hashable, Codable { + public struct Option: Equatable, Hashable, Codable, Sendable { public var value: Any { anyCodableValue.value } private let anyCodableValue: AnyCodable diff --git a/Sources/XcodeGraph/Models/RunAction.swift b/Sources/XcodeGraph/Models/RunAction.swift index cd0b95e1..a0c2e092 100644 --- a/Sources/XcodeGraph/Models/RunAction.swift +++ b/Sources/XcodeGraph/Models/RunAction.swift @@ -1,7 +1,7 @@ import Foundation import Path -public struct RunAction: Equatable, Codable { +public struct RunAction: Equatable, Codable, Sendable { // MARK: - Attributes public let configurationName: String diff --git a/Sources/XcodeGraph/Models/RunActionOptions.swift b/Sources/XcodeGraph/Models/RunActionOptions.swift index 5cae4294..941bdb18 100644 --- a/Sources/XcodeGraph/Models/RunActionOptions.swift +++ b/Sources/XcodeGraph/Models/RunActionOptions.swift @@ -2,7 +2,7 @@ import Foundation import Path /// Options for the `RunAction` action -public struct RunActionOptions: Equatable, Codable { +public struct RunActionOptions: Equatable, Codable, Sendable { /// App Language. public let language: String? @@ -53,7 +53,7 @@ public struct RunActionOptions: Equatable, Codable { } extension RunActionOptions { - public enum GPUFrameCaptureMode: String, Codable, Equatable { + public enum GPUFrameCaptureMode: String, Codable, Equatable, Sendable { case autoEnabled case metal case openGL diff --git a/Sources/XcodeGraph/Models/Scheme.swift b/Sources/XcodeGraph/Models/Scheme.swift index fb40a136..24b4cfe1 100644 --- a/Sources/XcodeGraph/Models/Scheme.swift +++ b/Sources/XcodeGraph/Models/Scheme.swift @@ -1,7 +1,7 @@ import Foundation import Path -public struct Scheme: Equatable, Codable { +public struct Scheme: Equatable, Codable, Sendable { // MARK: - Attributes public var name: String diff --git a/Sources/XcodeGraph/Models/SchemeDiagnosticsOptions.swift b/Sources/XcodeGraph/Models/SchemeDiagnosticsOptions.swift index 02dd794c..ee64e64a 100644 --- a/Sources/XcodeGraph/Models/SchemeDiagnosticsOptions.swift +++ b/Sources/XcodeGraph/Models/SchemeDiagnosticsOptions.swift @@ -1,6 +1,6 @@ import Foundation -public struct SchemeDiagnosticsOptions: Equatable, Codable { +public struct SchemeDiagnosticsOptions: Equatable, Codable, Sendable { public let addressSanitizerEnabled: Bool public let detectStackUseAfterReturnEnabled: Bool public let threadSanitizerEnabled: Bool diff --git a/Sources/XcodeGraph/Models/ScreenCaptureFormat.swift b/Sources/XcodeGraph/Models/ScreenCaptureFormat.swift index 49e7f59a..7e04d2ec 100644 --- a/Sources/XcodeGraph/Models/ScreenCaptureFormat.swift +++ b/Sources/XcodeGraph/Models/ScreenCaptureFormat.swift @@ -1,6 +1,6 @@ import Foundation -public enum ScreenCaptureFormat: String, Codable { +public enum ScreenCaptureFormat: String, Codable, Sendable { case screenshots case screenRecording } diff --git a/Sources/XcodeGraph/Models/Settings.swift b/Sources/XcodeGraph/Models/Settings.swift index a89d1ede..e1e87942 100644 --- a/Sources/XcodeGraph/Models/Settings.swift +++ b/Sources/XcodeGraph/Models/Settings.swift @@ -4,7 +4,7 @@ import Path public typealias SettingsDictionary = [String: SettingValue] public enum SettingValue: ExpressibleByStringInterpolation, ExpressibleByStringLiteral, ExpressibleByArrayLiteral, Equatable, - Codable + Codable, Sendable { case string(String) case array([String]) @@ -73,7 +73,7 @@ extension SettingsDictionary { } } -public struct Configuration: Equatable, Codable { +public struct Configuration: Equatable, Codable, Sendable { // MARK: - Attributes public var settings: SettingsDictionary @@ -98,7 +98,7 @@ public struct Configuration: Equatable, Codable { } } -public enum DefaultSettings: Codable, Equatable { +public enum DefaultSettings: Codable, Equatable, Sendable { case recommended(excluding: Set = []) case essential(excluding: Set = []) case none @@ -114,7 +114,7 @@ extension DefaultSettings { } } -public struct Settings: Equatable, Codable { +public struct Settings: Equatable, Codable, Sendable { public static let `default` = Settings( configurations: [.release: nil, .debug: nil], defaultSettings: .recommended diff --git a/Sources/XcodeGraph/Models/SimulatedLocation.swift b/Sources/XcodeGraph/Models/SimulatedLocation.swift index 0840c6ed..d275b46f 100644 --- a/Sources/XcodeGraph/Models/SimulatedLocation.swift +++ b/Sources/XcodeGraph/Models/SimulatedLocation.swift @@ -1,7 +1,7 @@ import Foundation import Path -public enum SimulatedLocation { +public enum SimulatedLocation: Sendable { case gpxFile(AbsolutePath) case reference(String) diff --git a/Sources/XcodeGraph/Models/SourceFile.swift b/Sources/XcodeGraph/Models/SourceFile.swift index 9defe25d..015ffce2 100644 --- a/Sources/XcodeGraph/Models/SourceFile.swift +++ b/Sources/XcodeGraph/Models/SourceFile.swift @@ -2,7 +2,7 @@ import Foundation import Path /// A type that represents a source file. -public struct SourceFile: ExpressibleByStringLiteral, Equatable, Codable { +public struct SourceFile: ExpressibleByStringLiteral, Equatable, Codable, Sendable { /// Source file path. public var path: AbsolutePath diff --git a/Sources/XcodeGraph/Models/Target.swift b/Sources/XcodeGraph/Models/Target.swift index 746bff74..bca9006c 100644 --- a/Sources/XcodeGraph/Models/Target.swift +++ b/Sources/XcodeGraph/Models/Target.swift @@ -2,7 +2,7 @@ import Foundation import Path // swiftlint:disable:next type_body_length -public struct Target: Equatable, Hashable, Comparable, Codable { +public struct Target: Equatable, Hashable, Comparable, Codable, Sendable { // MARK: - Static // Note: The `.docc` file type is technically both a valid source extension and folder extension diff --git a/Sources/XcodeGraph/Models/TargetDependency.swift b/Sources/XcodeGraph/Models/TargetDependency.swift index 9c1c20a2..817f5db1 100644 --- a/Sources/XcodeGraph/Models/TargetDependency.swift +++ b/Sources/XcodeGraph/Models/TargetDependency.swift @@ -1,13 +1,13 @@ import Foundation import Path -public enum LinkingStatus: String, Hashable, Codable { +public enum LinkingStatus: String, Hashable, Codable, Sendable { case required case optional } -public enum TargetDependency: Equatable, Hashable, Codable { - public enum PackageType: String, Equatable, Hashable, Codable { +public enum TargetDependency: Equatable, Hashable, Codable, Sendable { + public enum PackageType: String, Equatable, Hashable, Codable, Sendable { case runtime case plugin case macro diff --git a/Sources/XcodeGraph/Models/TargetReference.swift b/Sources/XcodeGraph/Models/TargetReference.swift index 5ff8b4d7..0289e749 100644 --- a/Sources/XcodeGraph/Models/TargetReference.swift +++ b/Sources/XcodeGraph/Models/TargetReference.swift @@ -1,7 +1,7 @@ import Foundation import Path -public struct TargetReference: Hashable, Codable { +public struct TargetReference: Hashable, Codable, Sendable { public var projectPath: AbsolutePath public var name: String diff --git a/Sources/XcodeGraph/Models/TargetScript.swift b/Sources/XcodeGraph/Models/TargetScript.swift index a9cf89a5..378f095b 100644 --- a/Sources/XcodeGraph/Models/TargetScript.swift +++ b/Sources/XcodeGraph/Models/TargetScript.swift @@ -2,12 +2,12 @@ import Foundation import Path /// It represents a target script build phase -public struct TargetScript: Equatable, Codable { +public struct TargetScript: Equatable, Codable, Sendable { /// Order when the script gets executed. /// /// - pre: Before the sources and resources build phase. /// - post: After the sources and resources build phase. - public enum Order: String, Equatable, Codable { + public enum Order: String, Equatable, Codable, Sendable { case pre case post } @@ -17,7 +17,7 @@ public struct TargetScript: Equatable, Codable { /// - tool: Executes the tool with the given arguments. Tuist will look up the tool on the environment's PATH. /// - scriptPath: Executes the file at the path with the given arguments. /// - embedded: Executes the embedded script. This should be a short command. - public enum Script: Equatable, Codable { + public enum Script: Equatable, Codable, Sendable { case tool(path: String, args: [String] = []) case scriptPath(path: AbsolutePath, args: [String] = []) case embedded(String) diff --git a/Sources/XcodeGraph/Models/TestAction.swift b/Sources/XcodeGraph/Models/TestAction.swift index 8575a4fb..2d5e2878 100644 --- a/Sources/XcodeGraph/Models/TestAction.swift +++ b/Sources/XcodeGraph/Models/TestAction.swift @@ -1,7 +1,7 @@ import Foundation import Path -public struct TestAction: Equatable, Codable { +public struct TestAction: Equatable, Codable, Sendable { // MARK: - Attributes public var testPlans: [TestPlan]? diff --git a/Sources/XcodeGraph/Models/TestPlan.swift b/Sources/XcodeGraph/Models/TestPlan.swift index 341603ae..6770089c 100644 --- a/Sources/XcodeGraph/Models/TestPlan.swift +++ b/Sources/XcodeGraph/Models/TestPlan.swift @@ -1,7 +1,7 @@ import Foundation import Path -public struct TestPlan: Hashable, Codable { +public struct TestPlan: Hashable, Codable, Sendable { public let name: String public let path: AbsolutePath public let testTargets: [TestableTarget] diff --git a/Sources/XcodeGraph/Models/TestableTarget.swift b/Sources/XcodeGraph/Models/TestableTarget.swift index c6522ab5..7d800202 100644 --- a/Sources/XcodeGraph/Models/TestableTarget.swift +++ b/Sources/XcodeGraph/Models/TestableTarget.swift @@ -2,7 +2,7 @@ import Foundation import Path /// Testable target describe target and tests information. -public struct TestableTarget: Equatable, Hashable, Codable { +public struct TestableTarget: Equatable, Hashable, Codable, Sendable { /// The target name and its project path. public let target: TargetReference /// Skip test target from TestAction. diff --git a/Sources/XcodeGraph/Models/TestingOptions.swift b/Sources/XcodeGraph/Models/TestingOptions.swift index 675db447..8f032606 100644 --- a/Sources/XcodeGraph/Models/TestingOptions.swift +++ b/Sources/XcodeGraph/Models/TestingOptions.swift @@ -1,4 +1,4 @@ -public struct TestingOptions: OptionSet, Codable, Hashable { +public struct TestingOptions: Sendable, OptionSet, Codable, Hashable { public let rawValue: Int public init(rawValue: Int) {