Skip to content

Commit 8dbb40b

Browse files
committed
added case for Linux
1 parent 4932204 commit 8dbb40b

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

Package.swift

+33
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import PackageDescription
55

6+
#if os(iOS) || os(macOS) || os(watchOS) || os(tvOS)
67
let package = Package(
78
name: "Keychain",
89
platforms: [.macOS(.v10_15)],
@@ -32,3 +33,35 @@ let package = Package(
3233
],
3334
swiftLanguageVersions: [.v5]
3435
)
36+
#else
37+
let package = Package(
38+
name: "Keychain",
39+
products: [
40+
// Products define the executables and libraries a package produces, and make them visible to other packages.
41+
.library(
42+
name: "Keychain",
43+
targets: ["Keychain"]),
44+
],
45+
dependencies: [
46+
// Dependencies declare other packages that this package depends on.
47+
// .package(url: /* package url */, from: "1.0.0"),
48+
.package(url: "https://github.com/apple/swift-crypto.git",
49+
from: "2.0.0"),
50+
.package(url: "https://github.com/OperatorFoundation/KeychainLinux.git", from: "1.0.0"),
51+
],
52+
targets: [
53+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
54+
// Targets can depend on other targets in this package, and on products in packages this package depends on.
55+
.target(
56+
name: "Keychain",
57+
dependencies: [
58+
"KeychainLinux",
59+
.product(name: "Crypto", package: "swift-crypto"),
60+
]),
61+
.testTarget(
62+
name: "KeychainTests",
63+
dependencies: ["Keychain", "KeychainLinux"]),
64+
],
65+
swiftLanguageVersions: [.v5]
66+
)
67+
#endif

Sources/Keychain/Keychain.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Crypto
33
import Foundation
44

5-
5+
#if os(macOS)
66
public class Keychain
77
{
88
public init() {}
@@ -155,3 +155,8 @@ public class Keychain
155155
}
156156
}
157157
}
158+
#else
159+
160+
@_exported import KeychainLinux
161+
162+
#endif

0 commit comments

Comments
 (0)