Skip to content

Commit bc62af9

Browse files
committed
NFC: Add Sendable annotations to PackageDescription APIs
1 parent 47573ce commit bc62af9

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

Sources/PackageDescription/BuildSettings.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
/// The build configuration, such as debug or release.
14-
public struct BuildConfiguration {
14+
public struct BuildConfiguration: Sendable {
1515
/// The configuration of the build. Valid values are `debug` and `release`.
1616
let config: String
1717

@@ -54,7 +54,7 @@ public struct BuildConfiguration {
5454
/// ]
5555
/// ),
5656
/// ```
57-
public struct BuildSettingCondition {
57+
public struct BuildSettingCondition: Sendable {
5858
/// The applicable platforms for this build setting condition.
5959
let platforms: [Platform]?
6060
/// The applicable build configuration for this build setting condition.
@@ -115,7 +115,7 @@ struct BuildSettingData {
115115
}
116116

117117
/// A C language build setting.
118-
public struct CSetting {
118+
public struct CSetting: Sendable {
119119
/// The abstract build setting data.
120120
let data: BuildSettingData
121121

@@ -185,7 +185,7 @@ public struct CSetting {
185185
}
186186

187187
/// A CXX-language build setting.
188-
public struct CXXSetting {
188+
public struct CXXSetting: Sendable {
189189
/// The data store for the CXX build setting.
190190
let data: BuildSettingData
191191

@@ -255,7 +255,7 @@ public struct CXXSetting {
255255
}
256256

257257
/// A Swift language build setting.
258-
public struct SwiftSetting {
258+
public struct SwiftSetting: Sendable {
259259
/// The data store for the Swift build setting.
260260
let data: BuildSettingData
261261

@@ -407,7 +407,7 @@ public struct SwiftSetting {
407407
}
408408

409409
/// A linker build setting.
410-
public struct LinkerSetting {
410+
public struct LinkerSetting: Sendable {
411411
/// The data store for the Linker setting.
412412
let data: BuildSettingData
413413

Sources/PackageDescription/Context.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/// The context encapsulates states that are known when Swift Package Manager interprets the package manifest,
1616
/// for example the location in the file system where the current package resides.
1717
@available(_PackageDescription, introduced: 5.6)
18-
public struct Context {
18+
public struct Context: Sendable {
1919
private static let model = try! ContextModel.decode()
2020

2121
/// The directory that contains `Package.swift`.
@@ -46,7 +46,7 @@ public struct Context {
4646

4747
/// Information about the git status of a given package, if available.
4848
@available(_PackageDescription, introduced: 6.0)
49-
public struct GitInformation {
49+
public struct GitInformation: Sendable {
5050
public let currentTag: String?
5151
public let currentCommit: String
5252
public let hasUncommittedChanges: Bool

Sources/PackageDescription/Product.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class Product {
6868
}
6969

7070
/// The executable product of a Swift package.
71-
public final class Executable: Product {
71+
public final class Executable: Product, @unchecked Sendable {
7272
/// The names of the targets in this product.
7373
public let targets: [String]
7474

@@ -79,7 +79,7 @@ public class Product {
7979
}
8080

8181
/// The library product of a Swift package.
82-
public final class Library: Product {
82+
public final class Library: Product, @unchecked Sendable {
8383
/// The different types of a library product.
8484
public enum LibraryType: String {
8585
/// A statically linked library.
@@ -105,7 +105,7 @@ public class Product {
105105
}
106106

107107
/// The plug-in product of a Swift package.
108-
public final class Plugin: Product {
108+
public final class Plugin: Product, @unchecked Sendable {
109109
/// The name of the plug-in target to vend as a product.
110110
public let targets: [String]
111111

Sources/PackageDescription/Resource.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
/// To learn more about package resources, see
3434
/// <doc:bundling-resources-with-a-swift-package>.
3535
@available(_PackageDescription, introduced: 5.3)
36-
public struct Resource {
36+
public struct Resource: Sendable {
3737

3838
/// Defines the explicit type of localization for resources.
39-
public enum Localization: String {
39+
public enum Localization: String, Sendable {
4040

4141
/// A constant that represents default localization.
4242
case `default`

Sources/PackageDescription/SupportedPlatforms.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
/// A platform supported by Swift Package Manager.
14-
public struct Platform: Equatable {
14+
public struct Platform: Equatable, Sendable {
1515

1616
/// The name of the platform.
1717
let name: String
@@ -88,7 +88,7 @@ public struct Platform: Equatable {
8888
/// package's deployment version. The deployment target of a package's
8989
/// dependencies must be lower than or equal to the top-level package's
9090
/// deployment target version for a particular platform.
91-
public struct SupportedPlatform: Equatable {
91+
public struct SupportedPlatform: Equatable, Sendable {
9292

9393
/// The platform.
9494
let platform: Platform
@@ -698,7 +698,7 @@ extension SupportedPlatform {
698698
}
699699
}
700700

701-
fileprivate protocol AppleOSVersion {
701+
fileprivate protocol AppleOSVersion: Sendable {
702702
static var name: String { get }
703703
static var minimumMajorVersion: Int { get }
704704
init(uncheckedVersion: String)

Sources/PackageDescription/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/// Increase the third digit of a version, or _patch version_, if you're making
3636
/// a backward-compatible bug fix. This allows clients to benefit from bugfixes
3737
/// to your package without incurring any maintenance burden.
38-
public struct Version {
38+
public struct Version: Sendable {
3939

4040
/// The major version according to the semantic versioning standard.
4141
public let major: Int

0 commit comments

Comments
 (0)