-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathPackage.swift
More file actions
130 lines (124 loc) · 4.64 KB
/
Copy pathPackage.swift
File metadata and controls
130 lines (124 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// swift-tools-version:6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import Foundation
import PackageDescription
let strictConcurrencyEnabled = true
extension Array<SwiftSetting> {
static var common: Self {
[
.enableUpcomingFeature("ExistentialAny"),
]
}
static var libraryTarget: Self {
if strictConcurrencyEnabled {
return common + [
.enableExperimentalFeature("StrictConcurrency=complete"),
]
} else {
return common
}
}
static var testTarget: Self {
common
}
}
var package = Package(
name: "OktaClient",
defaultLocalization: "en",
platforms: [
.iOS(.v13),
.tvOS(.v13),
.watchOS(.v7),
.visionOS(.v1),
.macOS(.v10_15),
.macCatalyst(.v13)
],
products: [
.library(name: "CommonSupport", targets: ["CommonSupport"]),
.library(name: "JSON", targets: ["JSON"]),
.library(name: "AuthFoundation", targets: ["CommonSupport", "JSON", "AuthFoundation"]),
.library(name: "OAuth2Auth", targets: ["OAuth2Auth"]),
.library(name: "OktaDirectAuth", targets: ["OktaDirectAuth"]),
.library(name: "OktaIdxAuth", targets: ["OktaIdxAuth"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.4.0")
],
targets: [
.target(name: "CommonSupport",
swiftSettings: .libraryTarget),
.target(name: "JSON",
dependencies: ["CommonSupport"],
swiftSettings: .libraryTarget),
.target(name: "AuthFoundation",
dependencies: ["CommonSupport", "JSON"],
resources: [.process("Resources")],
swiftSettings: .libraryTarget),
.target(name: "OAuth2Auth",
dependencies: [
.target(name: "AuthFoundation")
],
resources: [.process("Resources")],
swiftSettings: .libraryTarget),
.target(name: "OktaDirectAuth",
dependencies: [
.target(name: "AuthFoundation")
],
resources: [.process("Resources")],
swiftSettings: .libraryTarget),
.target(name: "OktaIdxAuth",
dependencies: [
.target(name: "AuthFoundation")
],
resources: [.process("Resources")],
swiftSettings: .libraryTarget),
] + [
.target(name: "TestCommon",
dependencies: ["AuthFoundation"],
path: "Tests/TestCommon",
swiftSettings: .testTarget),
.testTarget(name: "CommonSupportTests",
dependencies: ["CommonSupport", "TestCommon"],
swiftSettings: .testTarget),
.testTarget(name: "JSONTests",
dependencies: ["JSON", "TestCommon"],
swiftSettings: .testTarget),
.testTarget(name: "AuthFoundationTests",
dependencies: ["AuthFoundation", "TestCommon"],
resources: [
.copy("MockResponses"),
.copy("ConfigResources"),
],
swiftSettings: .testTarget),
.testTarget(name: "OAuth2AuthTests",
dependencies: ["OAuth2Auth", "TestCommon"],
resources: [ .copy("MockResponses") ],
swiftSettings: .testTarget),
.testTarget(name: "OktaDirectAuthTests",
dependencies: ["OktaDirectAuth", "TestCommon"],
resources: [ .copy("MockResponses") ],
swiftSettings: .testTarget),
.testTarget(name: "OktaIdxAuthTests",
dependencies: ["OktaIdxAuth", "TestCommon"],
resources: [.copy("MockResponses")],
swiftSettings: .testTarget),
],
swiftLanguageModes: [.v5, .v6]
)
#if canImport(AuthenticationServices) && canImport(UIKit) || canImport(AppKit)
package.targets.append(contentsOf: [
.target(name: "BrowserSignin",
dependencies: [
.target(name: "OAuth2Auth")
],
resources: [.process("Resources")],
swiftSettings: .libraryTarget),
.testTarget(name: "BrowserSigninTests",
dependencies: ["BrowserSignin", "TestCommon"],
resources: [ .copy("MockResponses") ],
swiftSettings: .testTarget)
])
package.products.append(
.library(name: "BrowserSignin", targets: ["BrowserSignin"])
)
#endif