Integrate AppCenter for internal builds

This commit is contained in:
Ali 2021-06-13 16:38:02 +04:00
parent 3851ac14ba
commit 04c6b6d7cf
5 changed files with 45 additions and 10 deletions

View File

@ -56,3 +56,10 @@ http_file(
urls = ["https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2-macos-universal.tar.gz"],
sha256 = "50afa2cb66bea6a0314ef28034f3ff1647325e30cf5940f97906a56fd9640bd8",
)
http_archive(
name = "appcenter_sdk",
urls = ["https://github.com/microsoft/appcenter-sdk-apple/releases/download/4.1.1/AppCenter-SDK-Apple-4.1.1.zip"],
sha256 = "032907801dc7784744a1ca8fd40d3eecc34a2e27a93a4b3993f617cca204a9f3",
build_file = "@//third-party/AppCenter:AppCenter.BUILD",
)

View File

@ -15,6 +15,11 @@ filegroup(
visibility = ["//visibility:public"],
)
appcenter_targets = [
"@appcenter_sdk//:AppCenter",
"@appcenter_sdk//:AppCenterCrashes",
]
swift_library(
name = "TelegramUI",
module_name = "TelegramUI",
@ -223,7 +228,12 @@ swift_library(
"//submodules/ImportStickerPackUI:ImportStickerPackUI",
"//submodules/GradientBackground:GradientBackground",
"//submodules/WallpaperBackgroundNode:WallpaperBackgroundNode",
],
] + select({
"@build_bazel_rules_apple//apple:ios_armv7": [],
"@build_bazel_rules_apple//apple:ios_arm64": appcenter_targets,
"//build-system:ios_sim_arm64": [],
"@build_bazel_rules_apple//apple:ios_x86_64": [],
}),
visibility = [
"//visibility:public",
],

View File

@ -34,9 +34,11 @@ import CoreSpotlight
import LightweightAccountData
import TelegramAudio
import DebugSettingsUI
#if canImport(BackgroundTasks)
import BackgroundTasks
#if os(iOS)
import AppCenter
import AppCenterCrashes
#endif
private let handleVoipNotifications = false
@ -486,14 +488,7 @@ final class SharedApplicationContext {
telegramUIDeclareEncodables()
GlobalExperimentalSettings.isAppStoreBuild = buildConfig.isAppStoreBuild
GlobalExperimentalSettings.enableFeed = false
#if DEBUG
//GlobalExperimentalSettings.enableFeed = true
#if targetEnvironment(simulator)
//GlobalTelegramCoreConfiguration.readMessages = false
#endif
#endif
self.window?.makeKeyAndVisible()
@ -1335,6 +1330,14 @@ final class SharedApplicationContext {
}*/
self.maybeCheckForUpdates()
#if os(iOS)
if !buildConfig.isAppStoreBuild, let appCenterId = buildConfig.appCenterId, !appCenterId.isEmpty {
AppCenter.start(withAppSecret: buildConfig.appCenterId, services: [
Crashes.self
])
}
#endif
return true
}

15
third-party/AppCenter/AppCenter.BUILD vendored Normal file
View File

@ -0,0 +1,15 @@
load("@build_bazel_rules_apple//apple:apple.bzl",
"apple_static_framework_import",
)
apple_static_framework_import(
name = "AppCenter",
framework_imports = glob(["AppCenter-SDK-Apple/iOS/AppCenter.framework/**"]),
visibility = ["//visibility:public"],
)
apple_static_framework_import(
name = "AppCenterCrashes",
framework_imports = glob(["AppCenter-SDK-Apple/iOS/AppCenterCrashes.framework/**"]),
visibility = ["//visibility:public"],
)

0
third-party/AppCenter/BUILD vendored Normal file
View File