Skip to content

Commit d7878b0

Browse files
authored
Replace 5.11 version with 6.0 in the code base (#7361)
This is a follow up to a corresponding toolchain PR swiftlang/swift#71707.
1 parent fc1b37a commit d7878b0

File tree

33 files changed

+121
-99
lines changed

33 files changed

+121
-99
lines changed

Fixtures/Miscellaneous/DoNotFilterLinkerDiagnostics/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.11
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

Fixtures/Miscellaneous/Plugins/DependentPlugins/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.11
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

Fixtures/Miscellaneous/Plugins/MySourceGenPluginUsingURLBasedAPI/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.11
1+
// swift-tools-version: 6.0
22
import PackageDescription
33

44
let package = Package(

Sources/Basics/SwiftVersion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public struct SwiftVersion {
5858
extension SwiftVersion {
5959
/// The current version of the package manager.
6060
public static let current = SwiftVersion(
61-
version: (5, 11, 0),
61+
version: (6, 0, 0),
6262
isDevelopment: true,
6363
buildIdentifier: getBuildIdentifier()
6464
)

Sources/Build/BuildManifest/LLBuildManifestBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ extension LLBuildManifestBuilder {
220220
}
221221
let additionalOutputs: [Node]
222222
if command.outputFiles.isEmpty {
223-
if target.toolsVersion >= .v5_11 {
223+
if target.toolsVersion >= .v6_0 {
224224
additionalOutputs = [.virtual("\(target.target.c99name)-\(command.configuration.displayName ?? "\(pluginNumber)")")]
225225
phonyOutputs += additionalOutputs
226226
} else {
227227
additionalOutputs = []
228-
observabilityScope.emit(warning: "Build tool command '\(displayName)' (applied to target '\(target.target.name)') does not declare any output files and therefore will not run. You may want to consider updating the given package to tools-version 5.11 (or higher) which would run such a build tool command even without declared outputs.")
228+
observabilityScope.emit(warning: "Build tool command '\(displayName)' (applied to target '\(target.target.name)') does not declare any output files and therefore will not run. You may want to consider updating the given package to tools-version 6.0 (or higher) which would run such a build tool command even without declared outputs.")
229229
}
230230
pluginNumber += 1
231231
} else {

Sources/Commands/PackageTools/Init.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extension SwiftPackageTool {
8383
}
8484
}
8585

86-
#if swift(<5.11)
86+
#if swift(<6.0)
8787
extension InitPackage.PackageType: ExpressibleByArgument {}
8888
#else
8989
extension InitPackage.PackageType: @retroactive ExpressibleByArgument {}

Sources/Commands/Utilities/APIDigester.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ extension SerializedDiagnostics.SourceLocation {
328328
}
329329
}
330330

331-
#if swift(<5.11)
331+
#if swift(<6.0)
332332
extension SerializedDiagnostics.SourceLocation: DiagnosticLocation {}
333333
#else
334334
extension SerializedDiagnostics.SourceLocation: @retroactive DiagnosticLocation {}

Sources/CoreCommands/Options.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ extension URL {
606606
}
607607
}
608608

609-
#if swift(<5.11)
609+
#if swift(<6.0)
610610
extension BuildConfiguration: ExpressibleByArgument {}
611611
extension AbsolutePath: ExpressibleByArgument {}
612612
extension WorkspaceConfiguration.CheckingMode: ExpressibleByArgument {}

Sources/PackageDescription/Context.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct Context {
2424
}
2525

2626
/// Information about the git status of a given package, if available.
27-
@available(_PackageDescription, introduced: 5.11)
27+
@available(_PackageDescription, introduced: 6.0)
2828
public static var gitInformation: GitInformation? {
2929
model.gitInformation.map {
3030
GitInformation(
@@ -45,7 +45,7 @@ public struct Context {
4545
}
4646

4747
/// Information about the git status of a given package, if available.
48-
@available(_PackageDescription, introduced: 5.11)
48+
@available(_PackageDescription, introduced: 6.0)
4949
public struct GitInformation {
5050
public let currentTag: String?
5151
public let currentCommit: String

Sources/PackageLoading/TargetSourcesBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public struct TargetSourcesBuilder {
185185
}
186186

187187
let additionalResources: [Resource]
188-
if toolsVersion >= .v5_11 {
188+
if toolsVersion >= .v6_0 {
189189
additionalResources = declaredResources.compactMap { resource in
190190
if handledResources.contains(resource.path) {
191191
return nil

Sources/PackageLoading/ToolsVersionParser.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ public struct ToolsVersionParser {
7171
while let newlineIndex = string.firstIndex(where: { $0.isNewline }) {
7272
string = String(string[newlineIndex...].dropFirst())
7373
if !string.isEmpty, let result = try? Self._parse(utf8String: string) {
74-
if result >= ToolsVersion.v5_11 {
74+
if result >= ToolsVersion.v6_0 {
7575
return result
7676
} else {
77-
throw Error.backwardIncompatiblePre5_11(.toolsVersionNeedsToBeFirstLine, specifiedVersion: result)
77+
throw Error.backwardIncompatiblePre6_0(.toolsVersionNeedsToBeFirstLine, specifiedVersion: result)
7878
}
7979
}
8080
}
@@ -504,9 +504,9 @@ extension ToolsVersionParser {
504504
case unidentified
505505
}
506506

507-
/// Details of backward-incompatible contents with Swift tools version < 5.11.
508-
public enum BackwardIncompatibilityPre5_11 {
509-
/// Tools-versions on subsequent lines of the manifest are only accepted by 5.11 or later.
507+
/// Details of backward-incompatible contents with Swift tools version < 6.0.
508+
public enum BackwardIncompatibilityPre6_0 {
509+
/// Tools-versions on subsequent lines of the manifest are only accepted by 6.0 or later.
510510
case toolsVersionNeedsToBeFirstLine
511511
}
512512

@@ -520,8 +520,8 @@ extension ToolsVersionParser {
520520
case malformedToolsVersionSpecification(_ malformationLocation: ToolsVersionSpecificationMalformationLocation)
521521
/// Backward-incompatible contents with Swift tools version < 5.4.
522522
case backwardIncompatiblePre5_4(_ incompatibility: BackwardIncompatibilityPre5_4, specifiedVersion: ToolsVersion)
523-
/// Backward-incompatible contents with Swift tools version < 5.11.
524-
case backwardIncompatiblePre5_11(_ incompatibility: BackwardIncompatibilityPre5_11, specifiedVersion: ToolsVersion)
523+
/// Backward-incompatible contents with Swift tools version < 6.0.
524+
case backwardIncompatiblePre6_0(_ incompatibility: BackwardIncompatibilityPre6_0, specifiedVersion: ToolsVersion)
525525

526526
public var description: String {
527527

@@ -588,10 +588,10 @@ extension ToolsVersionParser {
588588
case .unidentified:
589589
return "the manifest is backward-incompatible with Swift < 5.4, but the package manager is unable to pinpoint the exact incompatibility; consider replacing the current Swift tools version specification with '\(specifiedVersion.specification())' to specify Swift \(specifiedVersion) as the lowest Swift version supported by the project, then move the new specification to the very beginning of this manifest file; additionally, please consider filing a bug report on https://bugs.swift.org with this file attached"
590590
}
591-
case let .backwardIncompatiblePre5_11(incompatibility, _):
591+
case let .backwardIncompatiblePre6_0(incompatibility, _):
592592
switch incompatibility {
593593
case .toolsVersionNeedsToBeFirstLine:
594-
return "the manifest is backward-incompatible with Swift < 5.11 because the tools-version was specified in a subsequent line of the manifest, not the first line. Either move the tools-version specification or increase the required tools-version of your manifest"
594+
return "the manifest is backward-incompatible with Swift < 6.0 because the tools-version was specified in a subsequent line of the manifest, not the first line. Either move the tools-version specification or increase the required tools-version of your manifest"
595595
}
596596
}
597597

Sources/PackageModel/ToolsVersion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public struct ToolsVersion: Equatable, Hashable, Codable, Sendable {
3131
public static let v5_8 = ToolsVersion(version: "5.8.0")
3232
public static let v5_9 = ToolsVersion(version: "5.9.0")
3333
public static let v5_10 = ToolsVersion(version: "5.10.0")
34-
public static let v5_11 = ToolsVersion(version: "5.11.0")
34+
public static let v6_0 = ToolsVersion(version: "6.0.0")
3535
public static let vNext = ToolsVersion(version: "999.0.0")
3636

3737
/// The current tools version in use.

Sources/PackagePlugin/Command.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public enum Command {
4343
/// was generated as if in its source directory; other files are treated
4444
/// as resources as if explicitly listed in `Package.swift` using
4545
/// `.process(...)`.
46-
@available(_PackageDescription, introduced: 5.11)
46+
@available(_PackageDescription, introduced: 6.0)
4747
case buildCommand(
4848
displayName: String?,
4949
executable: URL,
@@ -76,7 +76,7 @@ public enum Command {
7676
/// this command was generated as if in its source directory; other
7777
/// files are treated as resources as if explicitly listed in
7878
/// `Package.swift` using `.process(...)`.
79-
@available(_PackageDescription, introduced: 5.11)
79+
@available(_PackageDescription, introduced: 6.0)
8080
case prebuildCommand(
8181
displayName: String?,
8282
executable: URL,
@@ -114,7 +114,7 @@ public extension Command {
114114
/// was generated as if in its source directory; other files are treated
115115
/// as resources as if explicitly listed in `Package.swift` using
116116
/// `.process(...)`.
117-
@available(_PackageDescription, deprecated: 5.11)
117+
@available(_PackageDescription, deprecated: 6.0)
118118
static func buildCommand(
119119
displayName: String?,
120120
executable: Path,
@@ -204,7 +204,7 @@ public extension Command {
204204
/// this command was generated as if in its source directory; other
205205
/// files are treated as resources as if explicitly listed in
206206
/// `Package.swift` using `.process(...)`.
207-
@available(_PackageDescription, deprecated: 5.11)
207+
@available(_PackageDescription, deprecated: 6.0)
208208
static func prebuildCommand(
209209
displayName: String?,
210210
executable: Path,

Sources/PackagePlugin/Context.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public struct PluginContext {
3131
/// write its outputs to that directory. The plugin may also create other
3232
/// directories for cache files and other file system content that either
3333
/// it or the command will need.
34-
@available(_PackageDescription, deprecated: 5.11)
34+
@available(_PackageDescription, deprecated: 6.0)
3535
public let pluginWorkDirectory: Path
3636

3737
/// The path of a writable directory into which the plugin or the build
@@ -46,7 +46,7 @@ public struct PluginContext {
4646
/// write its outputs to that directory. The plugin may also create other
4747
/// directories for cache files and other file system content that either
4848
/// it or the command will need.
49-
@available(_PackageDescription, introduced: 5.11)
49+
@available(_PackageDescription, introduced: 6.0)
5050
public let pluginWorkDirectoryURL: URL
5151

5252
/// Looks up and returns the path of a named command line executable tool.
@@ -86,12 +86,12 @@ public struct PluginContext {
8686

8787
/// The paths of directories of in which to search for tools that aren't in
8888
/// the `toolNamesToPaths` map.
89-
@available(_PackageDescription, deprecated: 5.11)
89+
@available(_PackageDescription, deprecated: 6.0)
9090
let toolSearchDirectories: [Path]
9191

9292
/// The paths of directories of in which to search for tools that aren't in
9393
/// the `toolNamesToPaths` map.
94-
@available(_PackageDescription, introduced: 5.11)
94+
@available(_PackageDescription, introduced: 6.0)
9595
let toolSearchDirectoryURLs: [URL]
9696

9797
/// Information about a particular tool that is available to a plugin.
@@ -100,11 +100,11 @@ public struct PluginContext {
100100
public let name: String
101101

102102
/// Full path of the built or provided tool in the file system.
103-
@available(_PackageDescription, deprecated: 5.11)
103+
@available(_PackageDescription, deprecated: 6.0)
104104
public let path: Path
105105

106106
/// Full path of the built or provided tool in the file system.
107-
@available(_PackageDescription, introduced: 5.11)
107+
@available(_PackageDescription, introduced: 6.0)
108108
public let url: URL
109109
}
110110
}

Sources/PackagePlugin/PackageManagerProxy.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ public struct PackageManager {
108108
/// Represents a single artifact produced during a build.
109109
public struct BuiltArtifact {
110110
/// Full path of the built artifact in the local file system.
111-
@available(_PackageDescription, deprecated: 5.11)
111+
@available(_PackageDescription, deprecated: 6.0)
112112
public var path: Path {
113113
return Path(url: url)
114114
}
115115

116116
/// Full path of the built artifact in the local file system.
117-
@available(_PackageDescription, introduced: 5.11)
117+
@available(_PackageDescription, introduced: 6.0)
118118
public var url: URL
119119

120120
/// The kind of artifact that was built.
@@ -182,14 +182,14 @@ public struct PackageManager {
182182

183183
/// Path of a generated `.profdata` file suitable for processing using
184184
/// `llvm-cov`, if `enableCodeCoverage` was set in the test parameters.
185-
@available(_PackageDescription, deprecated: 5.11)
185+
@available(_PackageDescription, deprecated: 6.0)
186186
public var codeCoverageDataFile: Path? {
187187
return codeCoverageDataFileURL.map { Path(url: $0) }
188188
}
189189

190190
/// Path of a generated `.profdata` file suitable for processing using
191191
/// `llvm-cov`, if `enableCodeCoverage` was set in the test parameters.
192-
@available(_PackageDescription, introduced: 5.11)
192+
@available(_PackageDescription, introduced: 6.0)
193193
public var codeCoverageDataFileURL: URL?
194194

195195
/// Represents the results of running some or all of the tests in a
@@ -265,13 +265,13 @@ public struct PackageManager {
265265
/// Represents the result of symbol graph generation.
266266
public struct SymbolGraphResult {
267267
/// The directory that contains the symbol graph files for the target.
268-
@available(_PackageDescription, deprecated: 5.11)
268+
@available(_PackageDescription, deprecated: 6.0)
269269
public var directoryPath: Path {
270270
return Path(url: directoryURL)
271271
}
272272

273273
/// The directory that contains the symbol graph files for the target.
274-
@available(_PackageDescription, introduced: 5.11)
274+
@available(_PackageDescription, introduced: 6.0)
275275
public var directoryURL: URL
276276
}
277277
}

0 commit comments

Comments
 (0)