Skip to content

Commit

Permalink
adapt writeToolsVersion(at:version:fs:) to using the new `ToolsVers…
Browse files Browse the repository at this point in the history
…ionLoader.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.
  • Loading branch information
WowbaggersLiquidLunch committed Nov 4, 2020
1 parent d739dd2 commit 857655a
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 93 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -15,7 +15,9 @@ Swift 5.3.1

* API Removal

`ToolsVersionLoader.Error.malformedToolsVersion(specifier: String, currentToolsVersion: ToolsVersion)` is now obsoleted, and replaced by `ToolsVersionLoader.Error.malformedToolsVersionSpecification(_ malformation: ToolsVersionSpecificationMalformation)`.
`ToolsVersionLoader.Error.malformedToolsVersion(specifier: String, currentToolsVersion: ToolsVersion)` is replaced by `ToolsVersionLoader.Error.malformedToolsVersionSpecification(_ malformation: ToolsVersionSpecificationMalformation)`.

`ToolsVersionLoader.split(_ bytes: ByteString) -> (versionSpecifier: String?, rest: [UInt8])` and `ToolsVersionLoader.regex` are together replaced by `ToolsVersionLoader.split(_ manifest: String) -> ManifestComponents`.

* Source Breakages for Swift Packages

Expand Down

0 comments on commit 857655a

Please sign in to comment.