Skip to content

Commit

Permalink
Disabled UserDefaults support for non-Apple platforms as its very pro…
Browse files Browse the repository at this point in the history
…blematic and not widely used anyway
  • Loading branch information
bok- committed Jul 17, 2024
1 parent 67527fd commit 6037028
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let package = Package(
dependencies: .init {
Package.Dependency.package(url: "https://github.com/apple/swift-async-algorithms.git", from: "1.0.0")
Package.Dependency.package(url: "https://github.com/nicklockwood/SwiftFormat.git", from: "0.54.1")
Package.Dependency.package(url: "https://github.com/apple/swift-syntax.git", exact: "600.0.0-prerelease-2024-06-12")
Package.Dependency.package(url: "https://github.com/swiftlang/swift-syntax.git", exact: "600.0.0-prerelease-2024-06-12")

#if os(Linux)
// Linux does not come bundled with swift-testing
Expand Down
4 changes: 4 additions & 0 deletions Sources/Vexil/Sources/UserDefaults+FlagValueSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
//
//===----------------------------------------------------------------------===//

#if !os(Linux)

#if canImport(AppKit)
import AppKit
#endif
Expand Down Expand Up @@ -145,3 +147,5 @@ private extension Any? {
return ObjectIdentifier(self) == object
}
}

#endif // !os(Linux)
4 changes: 4 additions & 0 deletions Tests/VexilTests/UserDefaultsDecodingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
//
//===----------------------------------------------------------------------===//

#if !os(Linux)

import Foundation
import Testing
@testable import Vexil
Expand Down Expand Up @@ -330,3 +332,5 @@ final class UserDefaultsDecodingTests {
}

}

#endif // !os(Linux)
4 changes: 4 additions & 0 deletions Tests/VexilTests/UserDefaultsEncodingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
//
//===----------------------------------------------------------------------===//

#if !os(Linux)

import Foundation
import Testing
@testable import Vexil
Expand Down Expand Up @@ -244,3 +246,5 @@ final class UserDefaultsEncodingTests {
}

}

#endif // !os(Linux)

0 comments on commit 6037028

Please sign in to comment.