Skip to content

Commit 857655a

Browse files
adapt writeToolsVersion(at:version:fs:) to using the new ToolsVersionLoader.split(_:)
This allows the old `ToolsVersionLoader.split(_:)` and `regex` to be fully removed instead of just deprecated. In implementing this change, the logic of the new `ToolsVersionLoader.split(_:)` is updated for the following 2 purposes: 1. Primarily to partially match the old `split(_:)`'s behaviour in deciding if the label of the Swift tools version specification is malformed. 2. Secondarily to provide a special path of diagnosis for when the label is prefixed with "swift-tools-version:" (case-insensitive). The comments left in the source provides much better details.
1 parent d739dd2 commit 857655a

File tree

4 files changed

+104
-93
lines changed

4 files changed

+104
-93
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ Swift 5.3.1
1515

1616
* API Removal
1717

18-
`ToolsVersionLoader.Error.malformedToolsVersion(specifier: String, currentToolsVersion: ToolsVersion)` is now obsoleted, and replaced by `ToolsVersionLoader.Error.malformedToolsVersionSpecification(_ malformation: ToolsVersionSpecificationMalformation)`.
18+
`ToolsVersionLoader.Error.malformedToolsVersion(specifier: String, currentToolsVersion: ToolsVersion)` is replaced by `ToolsVersionLoader.Error.malformedToolsVersionSpecification(_ malformation: ToolsVersionSpecificationMalformation)`.
19+
20+
`ToolsVersionLoader.split(_ bytes: ByteString) -> (versionSpecifier: String?, rest: [UInt8])` and `ToolsVersionLoader.regex` are together replaced by `ToolsVersionLoader.split(_ manifest: String) -> ManifestComponents`.
1921

2022
* Source Breakages for Swift Packages
2123

0 commit comments

Comments
 (0)