mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Introduce a build setting to detect Nightly builds. (#5852)
* Allow the AppIconBanner tool to be called with purely the build number. And use that for the Element Pro Nightly. * Use a build setting to determine Nightly builds.
This commit is contained in:
@@ -40,11 +40,10 @@ nonisolated enum AppBuildType {
|
||||
#if DEBUG
|
||||
return .debug
|
||||
#else
|
||||
switch InfoPlistReader.main.baseBundleIdentifier {
|
||||
case "io.element.elementx.nightly":
|
||||
return .nightly
|
||||
default:
|
||||
return .release
|
||||
if InfoPlistReader.main.isNightlyBuild {
|
||||
.nightly
|
||||
} else {
|
||||
.release
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ nonisolated struct InfoPlistReader {
|
||||
static let bundleShortVersion = "CFBundleShortVersionString"
|
||||
static let bundleDisplayName = "CFBundleDisplayName"
|
||||
static let productionAppName = "productionAppName"
|
||||
static let isNightlyBuild = "isNightlyBuild"
|
||||
static let utExportedTypeDeclarationsKey = "UTExportedTypeDeclarations"
|
||||
static let utTypeIdentifierKey = "UTTypeIdentifier"
|
||||
static let utDescriptionKey = "UTTypeDescription"
|
||||
@@ -93,6 +94,11 @@ nonisolated struct InfoPlistReader {
|
||||
infoPlistValue(forKey: Keys.productionAppName)
|
||||
}
|
||||
|
||||
/// Whether or not the build is from the Nightly stream.
|
||||
var isNightlyBuild: Bool {
|
||||
infoPlistValue(forKey: Keys.isNightlyBuild)
|
||||
}
|
||||
|
||||
// MARK: - Custom App Scheme
|
||||
|
||||
var appScheme: String {
|
||||
@@ -144,7 +150,7 @@ nonisolated struct InfoPlistReader {
|
||||
@_disfavoredOverload // Make sure optional types default to the optional version below.
|
||||
private func infoPlistValue<T>(forKey key: String) -> T {
|
||||
guard let result = bundle.object(forInfoDictionaryKey: key) as? T else {
|
||||
fatalError("Add \(key) into your target's Info.plst")
|
||||
fatalError("Add \(key) into your target's Info.plist")
|
||||
}
|
||||
return result
|
||||
}
|
||||
@@ -153,6 +159,11 @@ nonisolated struct InfoPlistReader {
|
||||
bundle.object(forInfoDictionaryKey: key) as? T
|
||||
}
|
||||
|
||||
private func infoPlistValue(forKey key: String) -> Bool {
|
||||
// Build setting values are stored as strings ("YES"/"NO")…
|
||||
(infoPlistValue(forKey: key) as NSString).boolValue
|
||||
}
|
||||
|
||||
private func customSchemeForName(_ name: String) -> String {
|
||||
let urlTypes: [[String: Any]] = infoPlistValue(forKey: Keys.bundleURLTypes)
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ class BugReportService: NSObject, BugReportServiceProtocol {
|
||||
|
||||
params.append(contentsOf: defaultParams)
|
||||
|
||||
if InfoPlistReader.main.baseBundleIdentifier == "io.element.elementx.nightly" {
|
||||
if AppBuildType.current == .nightly {
|
||||
bugReport.githubLabels.append("Nightly")
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,8 @@
|
||||
<string>$(CLASSIC_APP_KEYCHAIN_ACCESS_GROUP_IDENTIFIER)</string>
|
||||
<key>classicAppKeychainServiceIdentifier</key>
|
||||
<string>$(CLASSIC_APP_KEYCHAIN_SERVICE_IDENTIFIER)</string>
|
||||
<key>isNightlyBuild</key>
|
||||
<string>$(IS_NIGHTLY_BUILD)</string>
|
||||
<key>keychainAccessGroupIdentifier</key>
|
||||
<string>$(KEYCHAIN_ACCESS_GROUP_IDENTIFIER)</string>
|
||||
<key>productionAppName</key>
|
||||
|
||||
@@ -77,6 +77,7 @@ targets:
|
||||
classicAppKeychainAccessGroupIdentifier: $(CLASSIC_APP_KEYCHAIN_ACCESS_GROUP_IDENTIFIER)
|
||||
classicAppDeepLinkURL: $(CLASSIC_APP_DEEP_LINK_URL)
|
||||
productionAppName: $(PRODUCTION_APP_NAME)
|
||||
isNightlyBuild: $(IS_NIGHTLY_BUILD)
|
||||
ITSAppUsesNonExemptEncryption: false
|
||||
NSUserActivityTypes: [
|
||||
INSendMessageIntent,
|
||||
|
||||
Reference in New Issue
Block a user