Skip to content

Commit 5b6b613

Browse files
committed
Merge branch 'main' into 6.2-merge-main
2 parents 6f79e3f + 244f99c commit 5b6b613

File tree

54 files changed

+783
-696
lines changed

Some content is hidden

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

54 files changed

+783
-696
lines changed

Package.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,11 +815,17 @@ let package = Package(
815815
"Archiver/Inputs/invalid_archive.tar.gz",
816816
"Archiver/Inputs/invalid_archive.zip",
817817
"processInputs/long-stdout-stderr",
818+
"processInputs/long-stdout-stderr.bat",
818819
"processInputs/exit4",
820+
"processInputs/exit4.bat",
819821
"processInputs/simple-stdout-stderr",
822+
"processInputs/simple-stdout-stderr.bat",
820823
"processInputs/deadlock-if-blocking-io",
824+
"processInputs/deadlock-if-blocking-io.bat",
821825
"processInputs/echo",
826+
"processInputs/echo.bat",
822827
"processInputs/in-to-out",
828+
"processInputs/in-to-out.bat",
823829
]
824830
),
825831
.testTarget(

Sources/Basics/Concurrency/AsyncProcess.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,20 @@ package final class AsyncProcess {
387387
self.loggingHandler = loggingHandler ?? AsyncProcess.loggingHandler
388388
}
389389

390+
package convenience init(
391+
args: [String],
392+
environment: Environment = .current,
393+
outputRedirection: OutputRedirection = .collect,
394+
loggingHandler: LoggingHandler? = .none
395+
) {
396+
self.init(
397+
arguments: args,
398+
environment: environment,
399+
outputRedirection: outputRedirection,
400+
loggingHandler: loggingHandler
401+
)
402+
}
403+
390404
package convenience init(
391405
args: String...,
392406
environment: Environment = .current,

Sources/Commands/SwiftRunCommand.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ public struct SwiftRunCommand: AsyncSwiftCommand {
274274
// If the executable is implicit, search through root products.
275275
let rootExecutables = graph.rootPackages
276276
.flatMap { $0.products }
277-
.filter { $0.type == .executable || $0.type == .snippet }
277+
// The type checker slows down significantly when ProductTypes arent explicitly typed.
278+
.filter { $0.type == ProductType.executable || $0.type == ProductType.snippet }
278279
.map { $0.name }
279280

280281
// Error out if the package contains no executables.

Sources/PackageDescription/PackageDependency.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ extension Package.Dependency {
511511
/// ```
512512
///
513513
/// - Parameters:
514-
/// - name: The name of the package, or nil to deduce it from the URL.
515514
/// - url: The valid Git URL of the package.
516515
/// - range: The custom version range requirement.
517516
///
@@ -534,7 +533,6 @@ extension Package.Dependency {
534533
/// ```
535534
///
536535
/// - Parameters:
537-
/// - name: The name of the package, or nil to deduce it from the URL.
538536
/// - url: The valid Git URL of the package.
539537
/// - range: The custom version range requirement.
540538
/// - traits: The trait configuration of this dependency. Defaults to enabling the default traits.
@@ -585,7 +583,6 @@ extension Package.Dependency {
585583
/// ```
586584
///
587585
/// - Parameters:
588-
/// - name: The name of the package, or `nil` to deduce it from the URL.
589586
/// - url: The valid Git URL of the package.
590587
/// - range: The closed version range requirement.
591588
///
@@ -608,7 +605,6 @@ extension Package.Dependency {
608605
/// ```
609606
///
610607
/// - Parameters:
611-
/// - name: The name of the package, or `nil` to deduce it from the URL.
612608
/// - url: The valid Git URL of the package.
613609
/// - range: The closed version range requirement.
614610
/// - traits: The trait configuration of this dependency. Defaults to enabling the default traits.
@@ -788,7 +784,6 @@ extension Package.Dependency {
788784
/// Adds a remote package dependency given a version requirement.
789785
///
790786
/// - Parameters:
791-
/// - name: The name of the package, or nil to deduce it from the URL.
792787
/// - url: The valid Git URL of the package.
793788
/// - requirement: A dependency requirement. See static methods on `Package.Dependency.Requirement` for available options.
794789
///

Sources/PackageDescription/PackageDescription.docc/Curation/BuildSettingCondition.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66

77
- ``when(platforms:)``
88
- ``when(configuration:)``
9-
- ``when(platforms:configuration:)-2991l``
109
- ``when(platforms:configuration:)-475co``
10+
- ``when(platforms:configuration:traits:)``
11+
- ``when(platforms:configuration:)-2991l``

Sources/PackageDescription/PackageDescription.docc/Curation/Dependency.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,52 @@
55
### Creating a Package Dependency
66

77
- ``package(name:path:)``
8+
- ``package(name:path:traits:)``
9+
- ``package(path:)``
10+
- ``package(path:traits:)``
811
- ``package(url:from:)``
912
- ``package(url:_:)-2ys47``
1013
- ``package(url:_:)-1r6rc``
1114
- ``package(url:branch:)``
1215
- ``package(url:revision:)``
1316
- ``package(url:exact:)``
14-
- ``package(path:)``
17+
- ``package(url:exact:traits:)``
18+
- ``package(url:_:traits:)-(_,Range<Version>,_)``
19+
- ``package(url:_:traits:)-(_,ClosedRange<Version>,_)``
20+
- ``package(url:branch:traits:)``
21+
- ``package(url:from:traits:)``
22+
- ``package(url:revision:traits:)``
23+
- ``package(id:_:)-(_,Range<Version>)``
24+
- ``package(id:_:)-(_,ClosedRange<Version>)``
25+
- ``package(id:_:traits:)-(_,Range<Version>,_)``
26+
- ``package(id:_:traits:)-(_,ClosedRange<Version>,_)``
27+
- ``package(id:exact:)``
28+
- ``package(id:exact:traits:)``
29+
- ``package(id:from:)``
30+
- ``package(id:from:traits:)``
31+
- ``package(name:url:_:)-(String?,_,_)``
32+
- ``package(name:url:_:)-(_,_,Range<Version>)``
33+
- ``package(name:url:_:)-(_,_,ClosedRange<Version>)``
34+
- ``package(name:url:branch:)``
35+
- ``package(name:url:from:)``
36+
- ``package(name:url:revision:)``
37+
- ``package(url:_:)-(_,Package.Dependency.Requirement)``
38+
- ``name``
39+
- ``url``
1540

1641
### Declaring Requirements
1742

1843
- ``requirement-swift.property``
1944
- ``Requirement-swift.enum``
45+
- ``traits``
46+
- ``Trait``
47+
- ``RegistryRequirement``
48+
- ``SourceControlRequirement``
2049

2150
### Describing a Package Dependency
2251

52+
- ``name``
53+
- ``url``
2354
- ``kind-swift.property``
55+
- ``Kind``
2456
- ``Version``

Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CLanguageStandard-hash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
Hashes the C language standard by feeding the item into the given hasher.
88

9-
- Parameter into: The hasher.
9+
- Parameter hasher: The hasher.

Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/CXXLanguageStandard-hash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
Hashes the C++ language standard by feeding the item into the given hasher.
88

9-
- Parameter into: The hasher.
9+
- Parameter hasher: The hasher.

Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/LanguageTag-hash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
Hashes the language tag by feeding the item into the given hasher.
88

9-
- Parameter into: The hasher.
9+
- Parameter hasher: The hasher.

Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Library-LibraryType-hash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Implement this method to conform to the Hashable protocol. The components used f
1111
> Important:
1212
> Never call finalize() on hasher. Doing so may become a compile-time error in the future.
1313
14-
- Parameter into: The hasher to use when combining the components of this instance.
14+
- Parameter hasher: The hasher to use when combining the components of this instance.

Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Resource-Localization-hash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
Hashes the localization by feeding the item into the given hasher.
88

9-
- Parameter into: The hasher.
9+
- Parameter hasher: The hasher.

Sources/PackageDescription/PackageDescription.docc/Curation/Extensions/Target-TargetType-hash.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
Hashes the target type by feeding the item into the given hasher.
88

9-
- Parameter into: The hasher.
9+
- Parameter hasher: The hasher.
1010

1111

Sources/PackageDescription/PackageDescription.docc/Curation/LanguageTag.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
### Creating a Language Tag
66

7-
- ``init(_:)``
87
- <doc:/documentation/PackageDescription/LanguageTag/init(extendedGraphemeClusterLiteral:)-36buv>
98
- ``init(stringLiteral:)``
109
- <doc:/documentation/PackageDescription/LanguageTag/init(unicodeScalarLiteral:)-1j41k>
@@ -13,7 +12,6 @@
1312

1413
### Describing a Language Tag
1514

16-
- ``tag``
1715
- ``description``
1816

1917
### Hashing

Sources/PackageDescription/PackageDescription.docc/Curation/Package.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44

55
### Creating a Package
66

7+
- ``Package/init(name:defaultLocalization:platforms:pkgConfig:providers:products:dependencies:targets:swiftLanguageModes:cLanguageStandard:cxxLanguageStandard:)``
8+
- ``Package/init(name:defaultLocalization:platforms:pkgConfig:providers:products:traits:dependencies:targets:swiftLanguageModes:cLanguageStandard:cxxLanguageStandard:)``
79
- ``Package/init(name:defaultLocalization:platforms:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)``
10+
- ``Package/init(name:platforms:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)``
11+
- ``Package/init(name:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)-(_,_,_,_,_,_,[Int]?,_,_)``
12+
- ``Package/init(name:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)-(_,_,_,_,_,_,[SwiftVersion]?,_,_)``
13+
814

915
### Naming the Package
1016

@@ -37,16 +43,23 @@
3743
- ``Package/pkgConfig``
3844
- ``Package/providers``
3945

46+
### Configuring Traits
47+
48+
- ``Package/traits``
49+
- ``Trait``
50+
4051
### Declaring Package Dependencies
4152

4253
- ``Package/dependencies``
4354
- ``Package/Dependency``
4455

4556
### Declaring Supported Languages
4657

58+
- ``SwiftLanguageMode``
4759
- ``SwiftVersion``
4860
- ``CLanguageStandard``
4961
- ``CXXLanguageStandard``
62+
- ``Package/swiftLanguageModes``
5063
- ``Package/swiftLanguageVersions``
5164
- ``Package/cLanguageStandard``
5265
- ``Package/cxxLanguageStandard``

Sources/PackageDescription/PackageDescription.docc/Curation/Platform.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
- ``macOS``
1010
- ``tvOS``
1111
- ``watchOS``
12+
- ``visionOS``
1213
- ``macCatalyst``
1314
- ``driverKit``
1415
- ``android``
1516
- ``linux``
17+
- ``freebsd``
1618
- ``openbsd``
1719
- ``wasi``
1820
- ``windows``

Sources/PackageDescription/PackageDescription.docc/Curation/Resource.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
- ``process(_:localization:)``
88
- ``Localization``
99
- ``copy(_:)``
10+
- ``embedInCode(_:)``

Sources/PackageDescription/PackageDescription.docc/Curation/SupportedPlatforms.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,10 @@
5151
- <doc:/documentation/PackageDescription/Platform/driverKit>
5252
- ``DriverKitVersion``
5353

54-
### Supporting Linux
55-
56-
- <doc:/documentation/PackageDescription/Platform/linux>
57-
58-
### Type methods
54+
### Supporting Custom Platforms
5955

6056
- ``custom(_:versionString:)``
6157

6258
### Operator Functions
6359

6460
- ``!=(_:_:)``
65-
- ``==(_:_:)``

Sources/PackageDescription/PackageDescription.docc/Curation/SwiftVersion.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

Sources/PackageDescription/PackageDescription.docc/Curation/Target-Dependency.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,14 @@
44

55
### Creating a Target Dependency
66

7+
- ``product(name:package:moduleAliases:condition:)``
78
- ``product(name:package:condition:)``
89
- ``product(name:package:)-fp0j``
910
- ``product(name:package:)-2nako``
10-
- ``product(name:package:moduleAliases:)``
11-
- ``product(name:package:moduleAliases:condition:)``
11+
- ``productItem(name:package:condition:)``
1212
- ``target(name:condition:)``
1313
- ``target(name:)``
1414
- ``byName(name:condition:)``
1515
- ``byName(name:)``
1616
- ``TargetDependencyCondition``
1717
- ``init(stringLiteral:)``
18-
- ``init(extendedGraphemeClusterLiteral:)``
19-
- ``init(unicodeScalarLiteral:)``
20-
21-
### Identifying related types
22-
23-
- ``ExtendedGraphemeClusterLiteralType``
24-
- ``StringLiteralType``
25-
- ``UnicodeScalarLiteralType``

Sources/PackageDescription/PackageDescription.docc/Curation/Target-TargetDependencyCondition.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
### Creating a Dependency Condition
66

77
- ``when(platforms:)-5bxhc``
8+
- ``when(traits:)``
9+
- ``when(platforms:traits:)``
810
- ``when(platforms:)-4djh6``

Sources/PackageDescription/PackageDescription.docc/Curation/Target.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,29 @@
3030

3131
### Creating an Executable Target
3232

33-
- ``executableTarget(name:dependencies:path:exclude:sources:resources:publicHeadersPath:cSettings:cxxSettings:swiftSettings:linkerSettings:)``
33+
- ``executableTarget(name:dependencies:path:exclude:sources:resources:publicHeadersPath:packageAccess:cSettings:cxxSettings:swiftSettings:linkerSettings:plugins:)``
3434
- ``executableTarget(name:dependencies:path:exclude:sources:resources:publicHeadersPath:cSettings:cxxSettings:swiftSettings:linkerSettings:plugins:)``
35+
- ``executableTarget(name:dependencies:path:exclude:sources:resources:publicHeadersPath:cSettings:cxxSettings:swiftSettings:linkerSettings:)``
36+
37+
### Creating a Regular Target
38+
39+
- ``target(name:dependencies:path:exclude:sources:resources:publicHeadersPath:packageAccess:cSettings:cxxSettings:swiftSettings:linkerSettings:plugins:)``
40+
- ``target(name:dependencies:path:exclude:sources:resources:publicHeadersPath:cSettings:cxxSettings:swiftSettings:linkerSettings:plugins:)``
41+
- ``target(name:dependencies:path:exclude:sources:resources:publicHeadersPath:cSettings:cxxSettings:swiftSettings:linkerSettings:)``
42+
- ``target(name:dependencies:path:exclude:sources:publicHeadersPath:cSettings:cxxSettings:swiftSettings:linkerSettings:)``
43+
- ``target(name:dependencies:path:exclude:sources:publicHeadersPath:)``
44+
45+
### Creating a Test Target
46+
47+
- ``testTarget(name:dependencies:path:exclude:sources:resources:packageAccess:cSettings:cxxSettings:swiftSettings:linkerSettings:plugins:)``
48+
- ``testTarget(name:dependencies:path:exclude:sources:resources:cSettings:cxxSettings:swiftSettings:linkerSettings:plugins:)``
49+
- ``testTarget(name:dependencies:path:exclude:sources:resources:cSettings:cxxSettings:swiftSettings:linkerSettings:)``
50+
- ``testTarget(name:dependencies:path:exclude:sources:cSettings:cxxSettings:swiftSettings:linkerSettings:)``
51+
- ``testTarget(name:dependencies:path:exclude:sources:)``
3552

3653
### Creating a Plugin Target
3754

55+
- ``plugin(name:capability:dependencies:path:exclude:sources:packageAccess:)``
3856
- ``plugin(name:capability:dependencies:path:exclude:sources:)``
3957
- ``pluginCapability-swift.property``
4058
- ``PluginCapability-swift.enum``
@@ -61,6 +79,7 @@
6179
- ``SwiftSetting``
6280
- ``LinkerSetting``
6381
- ``PluginUsage``
82+
- ``packageAccess``
6483

6584
### Describing the Target Type
6685

Sources/PackageDescription/PackageDescription.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public final class Package {
171171
/// - pkgConfig: The name to use for C modules. If present, the Swift
172172
/// Package Manager searches for a `<name>.pc` file to get the
173173
/// additional flags required for a system target.
174+
/// - providers: The system package providers that this package uses.
174175
/// - products: The list of products that this package makes available for clients to use.
175176
/// - dependencies: The list of package dependencies.
176177
/// - targets: The list of targets that are part of this package.
@@ -211,6 +212,7 @@ public final class Package {
211212
/// - pkgConfig: The name to use for C modules. If present, the Swift
212213
/// Package Manager searches for a `<name>.pc` file to get the
213214
/// additional flags required for a system target.
215+
/// - providers: The system package providers that this package uses.
214216
/// - products: The list of products that this package makes available for clients to use.
215217
/// - dependencies: The list of package dependencies.
216218
/// - targets: The list of targets that are part of this package.

0 commit comments

Comments
 (0)