Skip to content

Commit c932b35

Browse files
authored
Update the project to Swift 5.4 (#110)
- Publish now uses the Swift 5.4 toolchain. - Since Swift 5.4 now enables automatic test discovery on all supported platforms, all of the infrastructure that was previously used to maintain Linux unit testing compatibility has now been removed. - Bump Ink to version 0.5.1, which includes a fix for Swift 5.4 compatibility.
1 parent 6a2003f commit c932b35

20 files changed

+6
-329
lines changed

Package.resolved

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

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.2
1+
// swift-tools-version:5.4
22

33
/**
44
* Publish
@@ -29,7 +29,7 @@ let package = Package(
2929
"Ink", "Plot", "Files", "Codextended", "ShellOut", "Sweep"
3030
]
3131
),
32-
.target(
32+
.executableTarget(
3333
name: "PublishCLI",
3434
dependencies: ["PublishCLICore"]
3535
),

Tests/LinuxMain.swift

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

Tests/PublishTests/Infrastructure/LinuxCompatibility.swift

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

Tests/PublishTests/Infrastructure/XCTestManifests.swift

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

Tests/PublishTests/Tests/CLITests.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,6 @@ final class CLITests: PublishTestCase {
8989
}
9090
}
9191

92-
extension CLITests {
93-
static var allTests: Linux.TestList<CLITests> {
94-
[
95-
("testWebsiteProjectGeneration", testWebsiteProjectGeneration),
96-
("testPluginProjectGeneration", testPluginProjectGeneration),
97-
("testSiteName", testSiteName),
98-
("testSiteNameFromLowercasedFolderName", testSiteNameFromLowercasedFolderName),
99-
("testSiteNameFromFolderNameStartingWithDigit", testSiteNameFromFolderNameStartingWithDigit),
100-
("testSiteNameFromCamelCaseFolderName", testSiteNameFromCamelCaseFolderName),
101-
("testSiteNameWithNonLetterValidCharactersFolderName", testSiteNameWithNonLetterValidCharactersFolderName),
102-
("testSiteNameFromFolderNameWithNonLetters", testSiteNameFromFolderNameWithNonLetters),
103-
("testSiteNameFromDigitsOnlyFolderName", testSiteNameFromDigitsOnlyFolderName)
104-
]
105-
}
106-
}
107-
10892
private extension CLITests {
10993
func makeCLI(in folder: Folder, command: String...) throws -> CLI {
11094
let thisFile = try File(path: "\(#file)")

Tests/PublishTests/Tests/ContentMutationTests.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -289,25 +289,3 @@ final class ContentMutationTests: PublishTestCase {
289289
XCTAssertEqual(site.pages["b"]?.title, "")
290290
}
291291
}
292-
293-
extension ContentMutationTests {
294-
static var allTests: Linux.TestList<ContentMutationTests> {
295-
[
296-
("testAddingItemUsingClosureAPI", testAddingItemUsingClosureAPI),
297-
("testAddingItemUsingPlotHierarchy", testAddingItemUsingPlotHierarchy),
298-
("testRemovingItemsMatchingPredicate", testRemovingItemsMatchingPredicate),
299-
("testMutatingAllSections", testMutatingAllSections),
300-
("testMutatingAllItems", testMutatingAllItems),
301-
("testMutatingItemsInSection", testMutatingItemsInSection),
302-
("testMutatingItemsMatchingPredicate", testMutatingItemsMatchingPredicate),
303-
("testMutatingItemsByChangingTags", testMutatingItemsByChangingTags),
304-
("testMutatingItemsByRemovingTags", testMutatingItemsByRemovingTags),
305-
("testSortingItems", testSortingItems),
306-
("testSortingItemsInSection", testSortingItemsInSection),
307-
("testMutatingItemUsingContentProxyProperties", testMutatingItemUsingContentProxyProperties),
308-
("testMutatingPage", testMutatingPage),
309-
("testMutatingPageByChangingPath", testMutatingPageByChangingPath),
310-
("testMutatingAllPagesMatchingPredicate", testMutatingAllPagesMatchingPredicate)
311-
]
312-
}
313-
}

Tests/PublishTests/Tests/DeploymentTests.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,3 @@ final class DeploymentTests: PublishTestCase {
146146
XCTAssertTrue(subfolder.containsSubfolder(at: "one/a"))
147147
}
148148
}
149-
150-
extension DeploymentTests {
151-
static var allTests: Linux.TestList<DeploymentTests> {
152-
[
153-
("testDeploymentSkippedByDefault", testDeploymentSkippedByDefault),
154-
("testGenerationStepsAndPluginsSkippedWhenDeploying", testGenerationStepsAndPluginsSkippedWhenDeploying),
155-
("testGitDeploymentMethod", testGitDeploymentMethod),
156-
("testGitDeploymentMethodWithError", testGitDeploymentMethodWithError),
157-
("testDeployingUsingCustomOutputFolder", testDeployingUsingCustomOutputFolder)
158-
]
159-
}
160-
}

Tests/PublishTests/Tests/ErrorTests.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,3 @@ final class ErrorTests: PublishTestCase {
169169
CommandLine.arguments.removeLast()
170170
}
171171
}
172-
173-
extension ErrorTests {
174-
static var allTests: Linux.TestList<ErrorTests> {
175-
[
176-
("testErrorForInvalidRootPath", testErrorForInvalidRootPath),
177-
("testErrorForMissingMarkdownMetadata", testErrorForMissingMarkdownMetadata),
178-
("testErrorForInvalidMarkdownMetadata", testErrorForInvalidMarkdownMetadata),
179-
("testErrorForThrowingDuringItemMutation", testErrorForThrowingDuringItemMutation),
180-
("testErrorForMissingPage", testErrorForMissingPage),
181-
("testErrorForThrowingDuringPageMutation", testErrorForThrowingDuringPageMutation),
182-
("testErrorForMissingFolder", testErrorForMissingFolder),
183-
("testErrorForMissingFile", testErrorForMissingFile),
184-
("testErrorForNoPublishingSteps", testErrorForNoPublishingSteps)
185-
]
186-
}
187-
}

Tests/PublishTests/Tests/FileIOTests.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,3 @@ final class FileIOTests: PublishTestCase {
134134
XCTAssertFalse(folder.containsFile(named: "Output/.hidden"))
135135
}
136136
}
137-
138-
extension FileIOTests {
139-
static var allTests: Linux.TestList<FileIOTests> {
140-
[
141-
("testCopyingFile", testCopyingFile),
142-
("testCopyingFileToSpecificFolder", testCopyingFileToSpecificFolder),
143-
("testCopyingFolder", testCopyingFolder),
144-
("testCopyingResourcesWithFolder", testCopyingResourcesWithFolder),
145-
("testCopyingResourcesWithoutFolder", testCopyingResourcesWithoutFolder),
146-
("testCreatingRootLevelFolder", testCreatingRootLevelFolder),
147-
("testRetrievingOutputFolder", testRetrievingOutputFolder),
148-
("testRetrievingOutputFile", testRetrievingOutputFile),
149-
("testCleaningHiddenFilesInOutputFolder", testCleaningHiddenFilesInOutputFolder)
150-
]
151-
}
152-
}

0 commit comments

Comments
 (0)