Skip to content

Commit cbf04b8

Browse files
committed
Upgrade Package Format to Swift 5.5
Upgrade from the 5.1 manifest to the 5.5 manifest now that Xcode 13 is required for Swift development. This enables better Docc integration in the package by default.
1 parent 2bbf56b commit cbf04b8

File tree

3 files changed

+43
-195
lines changed

3 files changed

+43
-195
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// swift-tools-version:5.1
2-
// In order to support users running on the latest Xcodes, please ensure that
3-
// [email protected] is kept in sync with this file.
1+
// swift-tools-version:5.5
2+
43
import PackageDescription
54
import class Foundation.ProcessInfo
65

@@ -44,31 +43,42 @@ let package = Package(
4443
targets: [
4544

4645
/// C modules wrapper for _InternalLibSwiftScan.
47-
.target(name: "CSwiftScan"),
46+
.target(name: "CSwiftScan",
47+
exclude: [ "CMakeLists.txt" ]),
4848

4949
/// The driver library.
5050
.target(
5151
name: "SwiftDriver",
52-
dependencies: ["SwiftOptions", "SwiftToolsSupport-auto",
53-
"CSwiftScan", "Yams"],
54-
exclude: ["CMakeLists.txt", "SwiftDriver.docc"]),
52+
dependencies: [
53+
"SwiftOptions",
54+
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
55+
"CSwiftScan",
56+
.product(name: "Yams", package: "Yams"),
57+
],
58+
exclude: ["CMakeLists.txt"]),
5559

5660
/// The execution library.
5761
.target(
5862
name: "SwiftDriverExecution",
59-
dependencies: ["SwiftDriver", "SwiftToolsSupport-auto"],
63+
dependencies: [
64+
"SwiftDriver",
65+
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core")
66+
],
6067
exclude: ["CMakeLists.txt"]),
6168

6269
/// Driver tests.
6370
.testTarget(
6471
name: "SwiftDriverTests",
65-
dependencies: ["SwiftDriver", "SwiftDriverExecution", "swift-driver",
66-
"TestUtilities"]),
72+
dependencies: ["SwiftDriver", "SwiftDriverExecution", "TestUtilities"]),
6773

6874
/// IncrementalImport tests
6975
.testTarget(
7076
name: "IncrementalImportTests",
71-
dependencies: ["IncrementalTestFramework", "TestUtilities", "SwiftToolsSupport-auto"]),
77+
dependencies: [
78+
"IncrementalTestFramework",
79+
"TestUtilities",
80+
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
81+
]),
7282

7383
.target(
7484
name: "IncrementalTestFramework",
@@ -86,32 +96,38 @@ let package = Package(
8696
/// The options library.
8797
.target(
8898
name: "SwiftOptions",
89-
dependencies: ["SwiftToolsSupport-auto"],
99+
dependencies: [
100+
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
101+
],
90102
exclude: ["CMakeLists.txt"]),
91103
.testTarget(
92104
name: "SwiftOptionsTests",
93105
dependencies: ["SwiftOptions"]),
94106

95107
/// The primary driver executable.
96-
.target(
108+
.executableTarget(
97109
name: "swift-driver",
98110
dependencies: ["SwiftDriverExecution", "SwiftDriver"],
99111
exclude: ["CMakeLists.txt"]),
100112

101113
/// The help executable.
102-
.target(
114+
.executableTarget(
103115
name: "swift-help",
104-
dependencies: ["SwiftOptions", "ArgumentParser", "SwiftToolsSupport-auto"],
116+
dependencies: [
117+
"SwiftOptions",
118+
.product(name: "ArgumentParser", package: "swift-argument-parser"),
119+
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
120+
],
105121
exclude: ["CMakeLists.txt"]),
106122

107123
/// The help executable.
108-
.target(
124+
.executableTarget(
109125
name: "swift-build-sdk-interfaces",
110126
dependencies: ["SwiftDriver", "SwiftDriverExecution"],
111127
exclude: ["CMakeLists.txt"]),
112128

113129
/// The `makeOptions` utility (for importing option definitions).
114-
.target(
130+
.executableTarget(
115131
name: "makeOptions",
116132
dependencies: []),
117133
],
@@ -123,14 +139,19 @@ if ProcessInfo.processInfo.environment["SWIFT_DRIVER_LLBUILD_FWK"] == nil {
123139
package.dependencies += [
124140
.package(url: "https://github.com/apple/swift-llbuild.git", .branch("main")),
125141
]
142+
package.targets.first(where: { $0.name == "SwiftDriverExecution" })!.dependencies += [
143+
.product(name: "llbuildSwift", package: "swift-llbuild"),
144+
]
126145
} else {
127146
// In Swift CI, use a local path to llbuild to interoperate with tools
128147
// like `update-checkout`, which control the sources externally.
129148
package.dependencies += [
130-
.package(path: "../llbuild"),
149+
.package(name: "llbuild", path: "../llbuild"),
150+
]
151+
package.targets.first(where: { $0.name == "SwiftDriverExecution" })!.dependencies += [
152+
.product(name: "llbuildSwift", package: "llbuild"),
131153
]
132154
}
133-
package.targets.first(where: { $0.name == "SwiftDriverExecution" })!.dependencies += ["llbuildSwift"]
134155
}
135156

136157
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
@@ -145,7 +166,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
145166
} else {
146167
package.dependencies += [
147168
.package(path: "../swift-tools-support-core"),
148-
.package(path: "../yams"),
169+
.package(name: "Yams", path: "../yams"),
149170
.package(path: "../swift-argument-parser"),
150171
]
151172
}

[email protected]

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

0 commit comments

Comments
 (0)