Skip to content

Commit 78498f7

Browse files
committed
Compatibility updates to reflect the removal of swift-indent, and the removal of swift-autolink-extract on macOS
1 parent c835d02 commit 78498f7

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,6 @@ extension Driver {
576576
return .batch
577577
case "swift-autolink-extract":
578578
return .autolinkExtract
579-
case "swift-indent":
580-
return .indent
581579
default:
582580
throw Error.invalidDriverName(driverName)
583581
}

Sources/SwiftDriver/Driver/DriverKind.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public enum DriverKind {
1717
case moduleWrap
1818
case frontend
1919
case autolinkExtract
20-
case indent
2120

2221
/// Returns true if driver kind is Swift compiler.
2322
var isSwiftCompiler: Bool {
@@ -41,9 +40,6 @@ extension DriverKind {
4140
case .frontend:
4241
return ["swift", "-frontend"]
4342

44-
case .indent:
45-
return ["swift-indent"]
46-
4743
case .interactive:
4844
return ["swift"]
4945

@@ -60,9 +56,6 @@ extension DriverKind {
6056
case .frontend:
6157
return "Swift frontend"
6258

63-
case .indent:
64-
return "Swift Format Tool"
65-
6659
case .batch, .interactive:
6760
return "Swift compiler"
6861

Sources/SwiftDriver/Options/Option.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ extension Option {
142142
case .frontend:
143143
return attributes.contains(.frontend)
144144

145-
case .indent:
146-
return attributes.contains(.indent)
147-
148145
case .interactive:
149146
return !attributes.contains(.noInteractive)
150147

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ final class SwiftDriverTests: XCTestCase {
125125

126126
try assertArgs("swiftc", "--driver-mode=swift", parseTo: .interactive, leaving: [])
127127
try assertArgs("swiftc", "--driver-mode=swift-autolink-extract", parseTo: .autolinkExtract, leaving: [])
128-
try assertArgs("swiftc", "--driver-mode=swift-indent", parseTo: .indent, leaving: [])
129128
try assertArgs("swift", "--driver-mode=swift-autolink-extract", parseTo: .autolinkExtract, leaving: [])
130129

131130
try assertArgs("swift", "-zelda", parseTo: .interactive, leaving: ["-zelda"])
@@ -761,7 +760,8 @@ final class SwiftDriverTests: XCTestCase {
761760
XCTAssertFalse(cmd.contains(.flag("-dylib")))
762761
XCTAssertFalse(cmd.contains(.flag("-shared")))
763762
}
764-
763+
// Only run tests which require swift-autolink-extract on Linux.
764+
#if os(Linux)
765765
do {
766766
// linux target
767767
var driver = try Driver(args: commonArgs + ["-emit-library", "-target", "x86_64-unknown-linux"])
@@ -818,6 +818,7 @@ final class SwiftDriverTests: XCTestCase {
818818
XCTAssertFalse(cmd.contains(.flag("-static")))
819819
XCTAssertFalse(cmd.contains(.flag("-shared")))
820820
}
821+
#endif
821822
}
822823

823824
func testSanitizerArgs() throws {

0 commit comments

Comments
 (0)