-
Notifications
You must be signed in to change notification settings - Fork 27
/
AppConstants.swift
189 lines (173 loc) · 5.29 KB
/
AppConstants.swift
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import UIKit
public enum AppBuildChannel {
case Release
case Beta
case Nightly
case Developer
case Aurora
}
public struct AppConstants {
public static let IsRunningTest = NSClassFromString("XCTestCase") != nil
// True if this process is executed as part of a Fastlane Snapshot test
public static let IsRunningFastlaneSnapshot = ProcessInfo.processInfo.arguments.contains("FASTLANE_SNAPSHOT")
/// Build Channel.
public static let BuildChannel: AppBuildChannel = {
#if MOZ_CHANNEL_RELEASE
return AppBuildChannel.Release
#elseif MOZ_CHANNEL_BETA
return AppBuildChannel.Beta
#elseif MOZ_CHANNEL_NIGHTLY
return AppBuildChannel.Nightly
#elseif MOZ_CHANNEL_FENNEC
return AppBuildChannel.Developer
#elseif MOZ_CHANNEL_AURORA
return AppBuildChannel.Aurora
#endif
}()
/// Whether we just mirror (false) or actively merge and upload (true).
public static let shouldMergeBookmarks = false
/// Flag indiciating if we are running in Debug mode or not.
public static let isDebug: Bool = {
#if MOZ_CHANNEL_FENNEC
return true
#else
return false
#endif
}()
/// Enables/disables the new Menu functionality
public static let MOZ_MENU: Bool = {
// Cliqz: disable MOZ MENU
return false
// #if MOZ_CHANNEL_RELEASE
// return true
// #elseif MOZ_CHANNEL_BETA
// return true
// #elseif MOZ_CHANNEL_NIGHTLY
// return true
// #elseif MOZ_CHANNEL_FENNEC
// return true
// #elseif MOZ_CHANNEL_AURORA
// return true
// #else
// return true
// #endif
}()
/// Enables/disables the notification bar that appears on the status bar area
public static let MOZ_STATUS_BAR_NOTIFICATION: Bool = {
#if MOZ_CHANNEL_RELEASE
return true
#elseif MOZ_CHANNEL_BETA
return true
#elseif MOZ_CHANNEL_NIGHTLY
return false
#elseif MOZ_CHANNEL_FENNEC
return true
#elseif MOZ_CHANNEL_AURORA
return true
#else
return true
#endif
}()
/// Enables/disables the de-duplication of awesomebar seach results functionality
public static let MOZ_AWESOMEBAR_DUPES: Bool = {
#if MOZ_CHANNEL_RELEASE
return true
#elseif MOZ_CHANNEL_BETA
return true
#elseif MOZ_CHANNEL_NIGHTLY
return true
#elseif MOZ_CHANNEL_FENNEC
return true
#elseif MOZ_CHANNEL_AURORA
return true
#else
return true
#endif
}()
/// Enables/disables the back/forward list from long pressing the back/forward button
public static let MOZ_BACK_FORWARD_LIST: Bool = {
#if MOZ_CHANNEL_RELEASE
return true
#elseif MOZ_CHANNEL_BETA
return true
#elseif MOZ_CHANNEL_NIGHTLY
return true
#elseif MOZ_CHANNEL_FENNEC
return true
#elseif MOZ_CHANNEL_AURORA
return true
#else
return true
#endif
}()
/// Enables/disables the undo toast for the delete all tabs
public static let MOZ_UNDO_DELETE_TABS_TOAST: Bool = {
#if MOZ_CHANNEL_RELEASE
return true
#elseif MOZ_CHANNEL_BETA
return true
#elseif MOZ_CHANNEL_NIGHTLY
return true
#elseif MOZ_CHANNEL_FENNEC
return true
#elseif MOZ_CHANNEL_AURORA
return true
#else
return true
#endif
}()
/// Enables/disables the choice of new tab behavior.
public static let MOZ_NEW_TAB_CHOICES: Bool = {
#if MOZ_CHANNEL_RELEASE
return true
#elseif MOZ_CHANNEL_BETA
return true
#elseif MOZ_CHANNEL_NIGHTLY
return true
#elseif MOZ_CHANNEL_FENNEC
return true
#elseif MOZ_CHANNEL_AURORA
return true
#else
return true
#endif
}()
/// Enables/disables the availability of No Image Mode.
public static let MOZ_NO_IMAGE_MODE: Bool = {
#if MOZ_CHANNEL_RELEASE
return false
#elseif MOZ_CHANNEL_BETA
return false
#elseif MOZ_CHANNEL_NIGHTLY
return false
#elseif MOZ_CHANNEL_FENNEC
return true
#elseif MOZ_CHANNEL_AURORA
return true
#else
return true
#endif
}()
/// Enables/disables the availability of Night Mode.
public static let MOZ_NIGHT_MODE: Bool = {
#if MOZ_CHANNEL_RELEASE
return false
#elseif MOZ_CHANNEL_BETA
return false
#elseif MOZ_CHANNEL_NIGHTLY
return false
#elseif MOZ_CHANNEL_FENNEC
return true
#elseif MOZ_CHANNEL_AURORA
return true
#else
return true
#endif
}()
public static let MOZ_FXA_PUSH: Bool = {
return false
}()
}