Skip to content

Commit

Permalink
Tool version updates (#8183)
Browse files Browse the repository at this point in the history
Update the `ToolsVersion` data structure to include the 6.1.0 release,
and update some references to ToolsVersion.vNext and 999.0 to
non-development releases.


References:
- #8139
- #8074
  • Loading branch information
bkhouri authored Dec 20, 2024
1 parent dd1f6f4 commit 307316d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions Sources/PackageModel/ToolsVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public struct ToolsVersion: Equatable, Hashable, Codable, Sendable {
public static let v5_9 = ToolsVersion(version: "5.9.0")
public static let v5_10 = ToolsVersion(version: "5.10.0")
public static let v6_0 = ToolsVersion(version: "6.0.0")
public static let v6_1 = ToolsVersion(version: "6.1.0")
public static let vNext = ToolsVersion(version: "999.0.0")

/// The current tools version in use.
Expand Down
18 changes: 16 additions & 2 deletions Tests/WorkspaceTests/WorkspaceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,25 @@ final class WorkspaceTests: XCTestCase {
XCTAssertMatch(try ws.interpreterFlags(for: packageManifest), [.equal("-swift-version"), .equal("6")])
}

do {
let ws = try createWorkspace(
"""
// swift-tools-version:5.9.2
import PackageDescription
let package = Package(
name: "foo"
)
"""
)

XCTAssertMatch(try ws.interpreterFlags(for: packageManifest), [.equal("-swift-version"), .equal("5")])
}

do {
// Invalid package manifest should still produce build settings.
let ws = try createWorkspace(
"""
// swift-tools-version:999.0
// swift-tools-version:5.9.2
import PackageDescription
"""
)
Expand Down Expand Up @@ -4122,7 +4136,7 @@ final class WorkspaceTests: XCTestCase {
.sourceControl(url: "https://localhost/org/foo", requirement: .upToNextMajor(from: "1.0.0")),
.sourceControl(url: "https://localhost/org/bar", requirement: .upToNextMinor(from: "1.1.0"))
],
toolsVersion: .vNext // change to the one after 5.9
toolsVersion: .v5_10
),
],
packages: [
Expand Down
3 changes: 3 additions & 0 deletions Utilities/build-using-self
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ set -x

env | sort

# Display toolchain version
swift --version

# Perform package update in order to get the latest commits for the dependencies.
swift package update
swift build -c $CONFIGURATION
Expand Down

0 comments on commit 307316d

Please sign in to comment.