File tree 2 files changed +39
-1
lines changed
2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import PackageDescription
5
5
6
+ #if os(iOS) || os(macOS) || os(watchOS) || os(tvOS)
6
7
let package = Package (
7
8
name: " Keychain " ,
8
9
platforms: [ . macOS( . v10_15) ] ,
@@ -32,3 +33,35 @@ let package = Package(
32
33
] ,
33
34
swiftLanguageVersions: [ . v5]
34
35
)
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
Original file line number Diff line number Diff line change 2
2
import Crypto
3
3
import Foundation
4
4
5
-
5
+ #if os(macOS)
6
6
public class Keychain
7
7
{
8
8
public init ( ) { }
@@ -155,3 +155,8 @@ public class Keychain
155
155
}
156
156
}
157
157
}
158
+ #else
159
+
160
+ @_exported import KeychainLinux
161
+
162
+ #endif
You can’t perform that action at this time.
0 commit comments