@@ -20,29 +20,29 @@ import struct TSCUtility.Version
20
20
/// Represents a package dependency.
21
21
public enum PackageDependency : Equatable , Hashable , Sendable {
22
22
/// A struct representing an enabled trait of a dependency.
23
- public struct Trait : Hashable , Sendable , Codable , ExpressibleByStringLiteral {
23
+ package struct Trait : Hashable , Sendable , Codable , ExpressibleByStringLiteral {
24
24
/// A condition that limits the application of a dependencies trait.
25
- public struct Condition : Hashable , Sendable , Codable {
25
+ package struct Condition : Hashable , Sendable , Codable {
26
26
/// The set of traits of this package that enable the dependencie's trait.
27
- public let traits : Set < String > ?
27
+ package let traits : Set < String > ?
28
28
29
29
public init ( traits: Set < String > ? ) {
30
30
self . traits = traits
31
31
}
32
32
}
33
33
34
34
/// The name of the enabled trait.
35
- public var name : String
35
+ package var name : String
36
36
37
37
/// The condition under which the trait is enabled.
38
- public var condition : Condition ?
38
+ package var condition : Condition ?
39
39
40
40
/// Initializes a new enabled trait.
41
41
///
42
42
/// - Parameters:
43
43
/// - name: The name of the enabled trait.
44
44
/// - condition: The condition under which the trait is enabled.
45
- public init (
45
+ package init (
46
46
name: String ,
47
47
condition: Condition ? = nil
48
48
) {
@@ -59,7 +59,7 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
59
59
/// - Parameters:
60
60
/// - name: The name of the enabled trait.
61
61
/// - condition: The condition under which the trait is enabled.
62
- public static func trait(
62
+ package static func trait(
63
63
name: String ,
64
64
condition: Condition ? = nil
65
65
) -> Trait {
@@ -79,7 +79,7 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
79
79
public let nameForTargetDependencyResolutionOnly : String ?
80
80
public let path : AbsolutePath
81
81
public let productFilter : ProductFilter
82
- public let traits : Set < Trait > ?
82
+ package let traits : Set < Trait > ?
83
83
}
84
84
85
85
public struct SourceControl : Equatable , Hashable , Encodable , Sendable {
@@ -88,7 +88,7 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
88
88
public let location : Location
89
89
public let requirement : Requirement
90
90
public let productFilter : ProductFilter
91
- public let traits : Set < Trait > ?
91
+ package let traits : Set < Trait > ?
92
92
93
93
public enum Requirement : Equatable , Hashable , Sendable {
94
94
case exact( Version )
@@ -107,7 +107,7 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
107
107
public let identity : PackageIdentity
108
108
public let requirement : Requirement
109
109
public let productFilter : ProductFilter
110
- public let traits : Set < Trait > ?
110
+ package let traits : Set < Trait > ?
111
111
112
112
/// The dependency requirement.
113
113
public enum Requirement : Equatable , Hashable , Sendable {
@@ -116,7 +116,7 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
116
116
}
117
117
}
118
118
119
- public var traits : Set < Trait > ? {
119
+ package var traits : Set < Trait > ? {
120
120
switch self {
121
121
case . fileSystem( let settings) :
122
122
return settings. traits
@@ -210,6 +210,21 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
210
210
}
211
211
212
212
public static func fileSystem(
213
+ identity: PackageIdentity ,
214
+ nameForTargetDependencyResolutionOnly: String ? ,
215
+ path: AbsolutePath ,
216
+ productFilter: ProductFilter
217
+ ) -> Self {
218
+ . fileSystem(
219
+ identity: identity,
220
+ nameForTargetDependencyResolutionOnly: nameForTargetDependencyResolutionOnly,
221
+ path: path,
222
+ productFilter: productFilter,
223
+ traits: nil
224
+ )
225
+ }
226
+
227
+ package static func fileSystem(
213
228
identity: PackageIdentity ,
214
229
nameForTargetDependencyResolutionOnly: String ? ,
215
230
path: AbsolutePath ,
@@ -228,6 +243,23 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
228
243
}
229
244
230
245
public static func localSourceControl(
246
+ identity: PackageIdentity ,
247
+ nameForTargetDependencyResolutionOnly: String ? ,
248
+ path: AbsolutePath ,
249
+ requirement: SourceControl . Requirement ,
250
+ productFilter: ProductFilter
251
+ ) -> Self {
252
+ . localSourceControl(
253
+ identity: identity,
254
+ nameForTargetDependencyResolutionOnly: nameForTargetDependencyResolutionOnly,
255
+ path: path,
256
+ requirement: requirement,
257
+ productFilter: productFilter,
258
+ traits: nil
259
+ )
260
+ }
261
+
262
+ package static func localSourceControl(
231
263
identity: PackageIdentity ,
232
264
nameForTargetDependencyResolutionOnly: String ? ,
233
265
path: AbsolutePath ,
@@ -246,6 +278,23 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
246
278
}
247
279
248
280
public static func remoteSourceControl(
281
+ identity: PackageIdentity ,
282
+ nameForTargetDependencyResolutionOnly: String ? ,
283
+ url: SourceControlURL ,
284
+ requirement: SourceControl . Requirement ,
285
+ productFilter: ProductFilter
286
+ ) -> Self {
287
+ . remoteSourceControl(
288
+ identity: identity,
289
+ nameForTargetDependencyResolutionOnly: nameForTargetDependencyResolutionOnly,
290
+ url: url,
291
+ requirement: requirement,
292
+ productFilter: productFilter,
293
+ traits: nil
294
+ )
295
+ }
296
+
297
+ package static func remoteSourceControl(
249
298
identity: PackageIdentity ,
250
299
nameForTargetDependencyResolutionOnly: String ? ,
251
300
url: SourceControlURL ,
@@ -264,6 +313,23 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
264
313
}
265
314
266
315
public static func sourceControl(
316
+ identity: PackageIdentity ,
317
+ nameForTargetDependencyResolutionOnly: String ? ,
318
+ location: SourceControl . Location ,
319
+ requirement: SourceControl . Requirement ,
320
+ productFilter: ProductFilter
321
+ ) -> Self {
322
+ . sourceControl(
323
+ identity: identity,
324
+ nameForTargetDependencyResolutionOnly: nameForTargetDependencyResolutionOnly,
325
+ location: location,
326
+ requirement: requirement,
327
+ productFilter: productFilter,
328
+ traits: nil
329
+ )
330
+ }
331
+
332
+ package static func sourceControl(
267
333
identity: PackageIdentity ,
268
334
nameForTargetDependencyResolutionOnly: String ? ,
269
335
location: SourceControl . Location ,
@@ -284,6 +350,19 @@ public enum PackageDependency: Equatable, Hashable, Sendable {
284
350
}
285
351
286
352
public static func registry(
353
+ identity: PackageIdentity ,
354
+ requirement: Registry . Requirement ,
355
+ productFilter: ProductFilter
356
+ ) -> Self {
357
+ . registry(
358
+ identity: identity,
359
+ requirement: requirement,
360
+ productFilter: productFilter,
361
+ traits: nil
362
+ )
363
+ }
364
+
365
+ package static func registry(
287
366
identity: PackageIdentity ,
288
367
requirement: Registry . Requirement ,
289
368
productFilter: ProductFilter ,
0 commit comments