-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathBuildSettings.swift
More file actions
63 lines (59 loc) · 2.4 KB
/
Copy pathBuildSettings.swift
File metadata and controls
63 lines (59 loc) · 2.4 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
import Foundation
/// Manages global build settings.
///
/// The build settings work differently depending on the environment:
///
/// - **Live** – the code runs as part of an app or app extensions with build
/// settings configured using the `Info.plist` file.
/// - **Preview** – the code runs as part of the SwiftPM or Xcode target. In this
/// environment, the build settings have predefined values that can also be
/// changed at runtime.
/// - **Test** – `BuildSettings` are not available when running unit tests as
/// they are incompatible with parallelized tests and are generally not recommended.
public struct BuildSettings: Sendable {
public var configuration: BuildConfiguration
// Secrets are configured at runtime for security necessity.
//
// To avoid unwrapping values that have to be present for the app to work, the value is an
// implicitly unwrapped optional.
//
// Call `BuildSettings.configure(secrets:)` as soon as possible in the consumer app life cycle
// to avoid crashes.
public internal(set) var secrets: BuildSecrets!
public var brand: AppBrand
public var pushNotificationAppID: String
public var appGroupName: String
public var appKeychainAccessGroup: String
/// The legacy cross-app keychain group shared by the WordPress and
/// Jetpack apps. nil where the app has no shared-group entitlement
/// (Reader): the key is simply absent from that app's Info.plist.
public var sharedKeychainAccessGroup: String?
public var eventNamePrefix: String
public var explatPlatform: String
public var itunesAppID: String
public var appURLScheme: String
public var jetpackAppURLScheme: String
public var about: ProductAboutDetails
public var zendeskSourcePlatform: String
public var mobileAnnounceAppID: String
public var authKeychainServiceName: String
public struct ProductAboutDetails: Sendable {
public var blogURL: URL
}
public static var current: BuildSettings {
switch BuildSettingsEnvironment.current {
case .live:
return .live
case .preview:
return .preview
case .test:
// TODO: update tests to ensure none of the rely on `BuildSettings` availability as it's incompatible with parallelized tests
return .live
}
}
}
public enum AppBrand: String, Sendable {
case wordpress
case jetpack
case reader
}