Skip to content

Commit e9b5a43

Browse files
p4checomluisbrown
authored andcommitted
Fix tests and Linux build
1 parent 91e0cf3 commit e9b5a43

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

Package.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,14 @@ let package = Package(
8585
// ])
8686
// )
8787
//}
88+
89+
#if os(Linux)
90+
for target in package.targets {
91+
target.dependencies = target.dependencies.filter {
92+
if case .productItem("_SwiftUINavigationState", _, _, _) = $0 {
93+
return false
94+
}
95+
return true
96+
}
97+
}
98+
#endif

Sources/ComposableArchitecture/Internal/Deprecations.swift

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ import SwiftUI
1212

1313
// MARK: - Deprecated after 0.45.0:
1414

15-
@available(
16-
*,
17-
deprecated,
18-
message: "Pass 'TextState' to the 'SwiftUI.Text' initializer, instead, e.g., 'Text(textState)'."
19-
)
20-
extension TextState: View {
21-
public var body: some View {
22-
Text(self)
15+
#if canImport(SwiftUI)
16+
@available(
17+
*,
18+
deprecated,
19+
message: "Pass 'TextState' to the 'SwiftUI.Text' initializer, instead, e.g., 'Text(textState)'."
20+
)
21+
extension TextState: View {
22+
public var body: some View {
23+
Text(self)
24+
}
2325
}
24-
}
26+
#endif
2527

2628
// MARK: - Deprecated after 0.42.0:
2729

Sources/ComposableArchitecture/Internal/Exports.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
@_exported import CustomDump
44
@_exported import Dependencies
55
@_exported import IdentifiedCollections
6-
@_exported import _SwiftUINavigationState
6+
#if !os(Linux)
7+
@_exported import _SwiftUINavigationState
8+
#endif

Tests/ComposableArchitectureTests/DebugTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
@testable import ComposableArchitecture
77

88
final class DebugTests: XCTestCase {
9-
#if canImport(SwiftUI)
109
func testDebugCaseOutput() {
1110
enum Action {
1211
case action1(Bool, label: String)

0 commit comments

Comments
 (0)