mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
7f9a459137
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@ -84,6 +84,7 @@ jobs:
|
|||||||
--bazel="$HOME/bazel-dist/bazel" \
|
--bazel="$HOME/bazel-dist/bazel" \
|
||||||
--bazelUserRoot="$BAZEL_USER_ROOT" \
|
--bazelUserRoot="$BAZEL_USER_ROOT" \
|
||||||
build \
|
build \
|
||||||
|
--disableParallelSwiftmoduleGeneration \
|
||||||
--configurationPath="$HOME/telegram-configuration" \
|
--configurationPath="$HOME/telegram-configuration" \
|
||||||
--buildNumber=$BUILD_NUMBER \
|
--buildNumber=$BUILD_NUMBER \
|
||||||
--configuration=release_universal
|
--configuration=release_universal
|
||||||
|
163
Telegram/BUILD
163
Telegram/BUILD
@ -30,6 +30,9 @@ load(
|
|||||||
"telegram_bundle_id",
|
"telegram_bundle_id",
|
||||||
"telegram_aps_environment",
|
"telegram_aps_environment",
|
||||||
"telegram_team_id",
|
"telegram_team_id",
|
||||||
|
"telegram_enable_icloud",
|
||||||
|
"telegram_enable_siri",
|
||||||
|
"telegram_enable_watch",
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@build_bazel_rules_apple//apple:resources.bzl",
|
load("@build_bazel_rules_apple//apple:resources.bzl",
|
||||||
@ -287,7 +290,7 @@ apple_pay_merchants_fragment = "" if apple_pay_merchants == [] else """
|
|||||||
<key>com.apple.developer.in-app-payments</key>
|
<key>com.apple.developer.in-app-payments</key>
|
||||||
<array>
|
<array>
|
||||||
""" + "\n".join([
|
""" + "\n".join([
|
||||||
" <string>{}</string>".format(merchant_id) for merchant_id in apple_pay_merchants
|
" <string>{merchant_id}</string>".format(merchant_id=merchant_id) for merchant_id in apple_pay_merchants
|
||||||
]) + "\n" + """
|
]) + "\n" + """
|
||||||
</array>
|
</array>
|
||||||
"""
|
"""
|
||||||
@ -304,44 +307,65 @@ official_carplay_fragment = """
|
|||||||
"""
|
"""
|
||||||
carplay_fragment = official_carplay_fragment if telegram_bundle_id in official_bundle_ids else ""
|
carplay_fragment = official_carplay_fragment if telegram_bundle_id in official_bundle_ids else ""
|
||||||
|
|
||||||
telegram_entitlements_template = """
|
icloud_fragment = "" if not telegram_enable_icloud else """
|
||||||
<key>com.apple.developer.icloud-services</key>
|
<key>com.apple.developer.icloud-services</key>
|
||||||
<array>
|
<array>
|
||||||
<string>CloudKit</string>
|
<string>CloudKit</string>
|
||||||
<string>CloudDocuments</string>
|
<string>CloudDocuments</string>
|
||||||
</array>
|
</array>
|
||||||
<key>com.apple.developer.icloud-container-identifiers</key>
|
<key>com.apple.developer.icloud-container-identifiers</key>
|
||||||
<array>
|
<array>
|
||||||
<string>iCloud.{telegram_bundle_id}</string>
|
<string>iCloud.{telegram_bundle_id}</string>
|
||||||
</array>
|
</array>
|
||||||
<key>aps-environment</key>
|
<key>com.apple.developer.icloud-container-environment</key>
|
||||||
<string>{telegram_aps_environment}</string>
|
<string>{telegram_icloud_environment}</string>
|
||||||
<key>com.apple.developer.associated-domains</key>
|
""".format(
|
||||||
<array>
|
telegram_bundle_id=telegram_bundle_id,
|
||||||
|
telegram_icloud_environment="Production" if telegram_aps_environment == "production" else "Development"
|
||||||
|
)
|
||||||
|
|
||||||
|
associated_domains_fragment = "" if telegram_bundle_id not in official_bundle_ids else """
|
||||||
|
<key>com.apple.developer.associated-domains</key>
|
||||||
|
<array>
|
||||||
<string>applinks:telegram.me</string>
|
<string>applinks:telegram.me</string>
|
||||||
<string>applinks:t.me</string>
|
<string>applinks:t.me</string>
|
||||||
</array>
|
</array>
|
||||||
<key>com.apple.developer.siri</key>
|
"""
|
||||||
<true/>
|
|
||||||
|
siri_fragment = "" if not telegram_enable_siri else """
|
||||||
|
<key>com.apple.developer.siri</key>
|
||||||
|
<true/>
|
||||||
|
"""
|
||||||
|
|
||||||
|
aps_fragment = "" if telegram_aps_environment == "" else """
|
||||||
|
<key>aps-environment</key>
|
||||||
|
<string>{telegram_aps_environment}</string>
|
||||||
|
""".format(telegram_aps_environment=telegram_aps_environment)
|
||||||
|
|
||||||
|
app_groups_fragment = """
|
||||||
<key>com.apple.security.application-groups</key>
|
<key>com.apple.security.application-groups</key>
|
||||||
<array>
|
<array>
|
||||||
<string>group.{telegram_bundle_id}</string>
|
<string>group.{telegram_bundle_id}</string>
|
||||||
</array>
|
</array>
|
||||||
<key>application-identifier</key>
|
<key>application-identifier</key>
|
||||||
<string>{telegram_team_id}.{telegram_bundle_id}</string>
|
<string>{telegram_team_id}.{telegram_bundle_id}</string>
|
||||||
<key>com.apple.developer.icloud-container-environment</key>
|
""".format(
|
||||||
<string>{telegram_icloud_environment}</string>
|
telegram_team_id=telegram_team_id,
|
||||||
""" + apple_pay_merchants_fragment + unrestricted_voip_fragment + carplay_fragment
|
telegram_bundle_id=telegram_bundle_id
|
||||||
|
)
|
||||||
|
|
||||||
plist_fragment(
|
plist_fragment(
|
||||||
name = "TelegramEntitlements",
|
name = "TelegramEntitlements",
|
||||||
extension = "entitlements",
|
extension = "entitlements",
|
||||||
template = telegram_entitlements_template.format(
|
template = "".join([
|
||||||
telegram_bundle_id = telegram_bundle_id,
|
app_groups_fragment,
|
||||||
telegram_team_id = telegram_team_id,
|
siri_fragment,
|
||||||
telegram_aps_environment = telegram_aps_environment,
|
associated_domains_fragment,
|
||||||
telegram_icloud_environment = "Production" if telegram_aps_environment == "production" else "Development",
|
icloud_fragment,
|
||||||
)
|
apple_pay_merchants_fragment,
|
||||||
|
unrestricted_voip_fragment,
|
||||||
|
carplay_fragment
|
||||||
|
])
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
@ -530,7 +554,6 @@ watchos_extension(
|
|||||||
|
|
||||||
watchos_application(
|
watchos_application(
|
||||||
name = "TelegramWatchApp",
|
name = "TelegramWatchApp",
|
||||||
#app_icons = ,
|
|
||||||
bundle_id = "{telegram_bundle_id}.watchkitapp".format(
|
bundle_id = "{telegram_bundle_id}.watchkitapp".format(
|
||||||
telegram_bundle_id = telegram_bundle_id,
|
telegram_bundle_id = telegram_bundle_id,
|
||||||
),
|
),
|
||||||
@ -1112,6 +1135,25 @@ swift_library(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = "SetMinOsVersionNotificationContentExtension",
|
||||||
|
cmd_bash =
|
||||||
|
"""
|
||||||
|
name=NotificationContentExtension.appex
|
||||||
|
cat $(location PatchMinOSVersion.source.sh) | sed -e "s/<<<MIN_OS_VERSION>>>/10\\.0/g" | sed -e "s/<<<NAME>>>/$$name/g" > $(location SetMinOsVersionNotificationContentExtension.sh)
|
||||||
|
""",
|
||||||
|
srcs = [
|
||||||
|
"PatchMinOSVersion.source.sh",
|
||||||
|
],
|
||||||
|
outs = [
|
||||||
|
"SetMinOsVersionNotificationContentExtension.sh",
|
||||||
|
],
|
||||||
|
executable = True,
|
||||||
|
visibility = [
|
||||||
|
"//visibility:public",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
ios_extension(
|
ios_extension(
|
||||||
name = "NotificationContentExtension",
|
name = "NotificationContentExtension",
|
||||||
bundle_id = "{telegram_bundle_id}.NotificationContent".format(
|
bundle_id = "{telegram_bundle_id}.NotificationContent".format(
|
||||||
@ -1127,7 +1169,8 @@ ios_extension(
|
|||||||
":BuildNumberInfoPlist",
|
":BuildNumberInfoPlist",
|
||||||
":AppNameInfoPlist",
|
":AppNameInfoPlist",
|
||||||
],
|
],
|
||||||
minimum_os_version = "10.0",
|
minimum_os_version = "9.0", # maintain the same minimum OS version across extensions
|
||||||
|
ipa_post_processor = ":SetMinOsVersionNotificationContentExtension",
|
||||||
provisioning_profile = select({
|
provisioning_profile = select({
|
||||||
":disableProvisioningProfilesSetting": None,
|
":disableProvisioningProfilesSetting": None,
|
||||||
"//conditions:default": "@build_configuration//provisioning:NotificationContent.mobileprovision",
|
"//conditions:default": "@build_configuration//provisioning:NotificationContent.mobileprovision",
|
||||||
@ -1194,6 +1237,25 @@ swift_library(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = "SetMinOsVersionWidgetExtension",
|
||||||
|
cmd_bash =
|
||||||
|
"""
|
||||||
|
name=WidgetExtension.appex
|
||||||
|
cat $(location PatchMinOSVersion.source.sh) | sed -e "s/<<<MIN_OS_VERSION>>>/14\\.0/g" | sed -e "s/<<<NAME>>>/$$name/g" > $(location SetMinOsVersionWidgetExtension.sh)
|
||||||
|
""",
|
||||||
|
srcs = [
|
||||||
|
"PatchMinOSVersion.source.sh",
|
||||||
|
],
|
||||||
|
outs = [
|
||||||
|
"SetMinOsVersionWidgetExtension.sh",
|
||||||
|
],
|
||||||
|
executable = True,
|
||||||
|
visibility = [
|
||||||
|
"//visibility:public",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
ios_extension(
|
ios_extension(
|
||||||
name = "WidgetExtension",
|
name = "WidgetExtension",
|
||||||
bundle_id = "{telegram_bundle_id}.Widget".format(
|
bundle_id = "{telegram_bundle_id}.Widget".format(
|
||||||
@ -1209,7 +1271,8 @@ ios_extension(
|
|||||||
":BuildNumberInfoPlist",
|
":BuildNumberInfoPlist",
|
||||||
":AppNameInfoPlist",
|
":AppNameInfoPlist",
|
||||||
],
|
],
|
||||||
minimum_os_version = "14.0",
|
minimum_os_version = "9.0", # maintain the same minimum OS version across extensions
|
||||||
|
ipa_post_processor = ":SetMinOsVersionWidgetExtension",
|
||||||
provides_main = True,
|
provides_main = True,
|
||||||
provisioning_profile = select({
|
provisioning_profile = select({
|
||||||
":disableProvisioningProfilesSetting": None,
|
":disableProvisioningProfilesSetting": None,
|
||||||
@ -1296,6 +1359,25 @@ swift_library(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = "SetMinOsVersionIntentsExtension",
|
||||||
|
cmd_bash =
|
||||||
|
"""
|
||||||
|
name=IntentsExtension.appex
|
||||||
|
cat $(location PatchMinOSVersion.source.sh) | sed -e "s/<<<MIN_OS_VERSION>>>/10\\.0/g" | sed -e "s/<<<NAME>>>/$$name/g" > $(location SetMinOsVersionIntentsExtension.sh)
|
||||||
|
""",
|
||||||
|
srcs = [
|
||||||
|
"PatchMinOSVersion.source.sh",
|
||||||
|
],
|
||||||
|
outs = [
|
||||||
|
"SetMinOsVersionIntentsExtension.sh",
|
||||||
|
],
|
||||||
|
executable = True,
|
||||||
|
visibility = [
|
||||||
|
"//visibility:public",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
ios_extension(
|
ios_extension(
|
||||||
name = "IntentsExtension",
|
name = "IntentsExtension",
|
||||||
bundle_id = "{telegram_bundle_id}.SiriIntents".format(
|
bundle_id = "{telegram_bundle_id}.SiriIntents".format(
|
||||||
@ -1311,7 +1393,8 @@ ios_extension(
|
|||||||
":BuildNumberInfoPlist",
|
":BuildNumberInfoPlist",
|
||||||
":AppNameInfoPlist",
|
":AppNameInfoPlist",
|
||||||
],
|
],
|
||||||
minimum_os_version = "10.0",
|
minimum_os_version = "9.0", # maintain the same minimum OS version across extensions
|
||||||
|
ipa_post_processor = ":SetMinOsVersionIntentsExtension",
|
||||||
provisioning_profile = select({
|
provisioning_profile = select({
|
||||||
":disableProvisioningProfilesSetting": None,
|
":disableProvisioningProfilesSetting": None,
|
||||||
"//conditions:default": "@build_configuration//provisioning:Intents.mobileprovision",
|
"//conditions:default": "@build_configuration//provisioning:Intents.mobileprovision",
|
||||||
@ -1350,6 +1433,25 @@ plist_fragment(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = "SetMinOsVersionNotificationServiceExtension",
|
||||||
|
cmd_bash =
|
||||||
|
"""
|
||||||
|
name=NotificationServiceExtension.appex
|
||||||
|
cat $(location PatchMinOSVersion.source.sh) | sed -e "s/<<<MIN_OS_VERSION>>>/10\\.0/g" | sed -e "s/<<<NAME>>>/$$name/g" > $(location SetMinOsVersionNotificationServiceExtension.sh)
|
||||||
|
""",
|
||||||
|
srcs = [
|
||||||
|
"PatchMinOSVersion.source.sh",
|
||||||
|
],
|
||||||
|
outs = [
|
||||||
|
"SetMinOsVersionNotificationServiceExtension.sh",
|
||||||
|
],
|
||||||
|
executable = True,
|
||||||
|
visibility = [
|
||||||
|
"//visibility:public",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
ios_extension(
|
ios_extension(
|
||||||
name = "NotificationServiceExtension",
|
name = "NotificationServiceExtension",
|
||||||
bundle_id = "{telegram_bundle_id}.NotificationService".format(
|
bundle_id = "{telegram_bundle_id}.NotificationService".format(
|
||||||
@ -1365,7 +1467,8 @@ ios_extension(
|
|||||||
":BuildNumberInfoPlist",
|
":BuildNumberInfoPlist",
|
||||||
":AppNameInfoPlist",
|
":AppNameInfoPlist",
|
||||||
],
|
],
|
||||||
minimum_os_version = "10.0",
|
minimum_os_version = "9.0", # maintain the same minimum OS version across extensions
|
||||||
|
ipa_post_processor = ":SetMinOsVersionNotificationServiceExtension",
|
||||||
provisioning_profile = select({
|
provisioning_profile = select({
|
||||||
":disableProvisioningProfilesSetting": None,
|
":disableProvisioningProfilesSetting": None,
|
||||||
"//conditions:default": "@build_configuration//provisioning:NotificationService.mobileprovision",
|
"//conditions:default": "@build_configuration//provisioning:NotificationService.mobileprovision",
|
||||||
@ -1598,7 +1701,7 @@ ios_application(
|
|||||||
watch_application = select({
|
watch_application = select({
|
||||||
":disableExtensionsSetting": None,
|
":disableExtensionsSetting": None,
|
||||||
"//conditions:default": ":TelegramWatchApp",
|
"//conditions:default": ":TelegramWatchApp",
|
||||||
}),
|
}) if telegram_enable_watch else None,
|
||||||
deps = [
|
deps = [
|
||||||
":Main",
|
":Main",
|
||||||
":Lib",
|
":Lib",
|
||||||
|
@ -5,7 +5,7 @@ import NotificationServiceObjC
|
|||||||
|
|
||||||
private let queue = Queue()
|
private let queue = Queue()
|
||||||
|
|
||||||
@available(iOSApplicationExtension 10.0, *)
|
@available(iOSApplicationExtension 10.0, iOS 10.0, *)
|
||||||
@objc(NotificationService)
|
@objc(NotificationService)
|
||||||
final class NotificationService: UNNotificationServiceExtension {
|
final class NotificationService: UNNotificationServiceExtension {
|
||||||
private let impl: QueueLocalObject<NotificationServiceImpl>
|
private let impl: QueueLocalObject<NotificationServiceImpl>
|
||||||
|
15
Telegram/PatchMinOSVersion.source.sh
Normal file
15
Telegram/PatchMinOSVersion.source.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
name=<<<NAME>>>
|
||||||
|
version=<<<MIN_OS_VERSION>>>
|
||||||
|
|
||||||
|
f="$1/$name"
|
||||||
|
|
||||||
|
plist_path="$f/Info.plist"
|
||||||
|
plutil -replace MinimumOSVersion -string $version "$plist_path"
|
||||||
|
if [ "$version" == "14.0" ]; then
|
||||||
|
binary_path="$f/$(basename $f | sed -e s/\.appex//g)"
|
||||||
|
xcrun lipo "$binary_path" -remove armv7 -o "$binary_path" 2>/dev/null || true
|
||||||
|
fi
|
@ -1,3 +1,5 @@
|
|||||||
|
#if arch(arm64) || arch(x86_64)
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import NotificationCenter
|
import NotificationCenter
|
||||||
import BuildConfig
|
import BuildConfig
|
||||||
@ -63,6 +65,7 @@ private func rootPathForBasePath(_ appGroupPath: String) -> String {
|
|||||||
return appGroupPath + "/telegram-data"
|
return appGroupPath + "/telegram-data"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
struct Provider: IntentTimelineProvider {
|
struct Provider: IntentTimelineProvider {
|
||||||
public typealias Entry = SimpleEntry
|
public typealias Entry = SimpleEntry
|
||||||
|
|
||||||
@ -221,6 +224,7 @@ struct Provider: IntentTimelineProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
struct AvatarsProvider: IntentTimelineProvider {
|
struct AvatarsProvider: IntentTimelineProvider {
|
||||||
public typealias Entry = SimpleEntry
|
public typealias Entry = SimpleEntry
|
||||||
|
|
||||||
@ -379,6 +383,7 @@ struct AvatarsProvider: IntentTimelineProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
struct SimpleEntry: TimelineEntry {
|
struct SimpleEntry: TimelineEntry {
|
||||||
enum Contents {
|
enum Contents {
|
||||||
case recent
|
case recent
|
||||||
@ -396,6 +401,7 @@ enum PeersWidgetData {
|
|||||||
case peers(ParsedPeers)
|
case peers(ParsedPeers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
struct AvatarItemView: View {
|
struct AvatarItemView: View {
|
||||||
var peer: ParsedPeer?
|
var peer: ParsedPeer?
|
||||||
var itemSize: CGFloat
|
var itemSize: CGFloat
|
||||||
@ -415,6 +421,7 @@ struct AvatarItemView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
struct WidgetView: View {
|
struct WidgetView: View {
|
||||||
@Environment(\.widgetFamily) private var widgetFamily
|
@Environment(\.widgetFamily) private var widgetFamily
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
@ -853,6 +860,7 @@ struct WidgetView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
struct AvatarsWidgetView: View {
|
struct AvatarsWidgetView: View {
|
||||||
@Environment(\.widgetFamily) private var widgetFamily
|
@Environment(\.widgetFamily) private var widgetFamily
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
@ -952,6 +960,7 @@ private let buildConfig: BuildConfig = {
|
|||||||
return buildConfig
|
return buildConfig
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
func getWidgetData(contents: SimpleEntry.Contents) -> PeersWidgetData {
|
func getWidgetData(contents: SimpleEntry.Contents) -> PeersWidgetData {
|
||||||
switch contents {
|
switch contents {
|
||||||
case .recent:
|
case .recent:
|
||||||
@ -963,6 +972,7 @@ func getWidgetData(contents: SimpleEntry.Contents) -> PeersWidgetData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
struct Static_Widget: Widget {
|
struct Static_Widget: Widget {
|
||||||
private let kind: String = "Static_Widget"
|
private let kind: String = "Static_Widget"
|
||||||
|
|
||||||
@ -978,6 +988,7 @@ struct Static_Widget: Widget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
struct Static_AvatarsWidget: Widget {
|
struct Static_AvatarsWidget: Widget {
|
||||||
private let kind: String = "Static_AvatarsWidget"
|
private let kind: String = "Static_AvatarsWidget"
|
||||||
|
|
||||||
@ -994,9 +1005,31 @@ struct Static_AvatarsWidget: Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@main
|
@main
|
||||||
|
struct AllWidgetsEntryPoint {
|
||||||
|
static func main() {
|
||||||
|
if #available(iOS 14.0, *) {
|
||||||
|
AllWidgets.main()
|
||||||
|
} else {
|
||||||
|
preconditionFailure()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@available(iOSApplicationExtension 14.0, iOS 14.0, *)
|
||||||
struct AllWidgets: WidgetBundle {
|
struct AllWidgets: WidgetBundle {
|
||||||
var body: some Widget {
|
var body: some Widget {
|
||||||
Static_Widget()
|
Static_Widget()
|
||||||
Static_AvatarsWidget()
|
Static_AvatarsWidget()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
@main
|
||||||
|
class MyApp {
|
||||||
|
static func main() {
|
||||||
|
preconditionFailure("Not supported")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -27,6 +27,7 @@ class BazelCommandLine:
|
|||||||
self.build_number = None
|
self.build_number = None
|
||||||
self.configuration_args = None
|
self.configuration_args = None
|
||||||
self.configuration_path = None
|
self.configuration_path = None
|
||||||
|
self.split_submodules = False
|
||||||
|
|
||||||
self.common_args = [
|
self.common_args = [
|
||||||
# https://docs.bazel.build/versions/master/command-line-reference.html
|
# https://docs.bazel.build/versions/master/command-line-reference.html
|
||||||
@ -49,12 +50,6 @@ class BazelCommandLine:
|
|||||||
]
|
]
|
||||||
|
|
||||||
self.common_build_args = [
|
self.common_build_args = [
|
||||||
# https://github.com/bazelbuild/rules_swift
|
|
||||||
# If enabled and whole module optimisation is being used, the `*.swiftdoc`,
|
|
||||||
# `*.swiftmodule` and `*-Swift.h` are generated with a separate action
|
|
||||||
# rather than as part of the compilation.
|
|
||||||
'--features=swift.split_derived_files_generation',
|
|
||||||
|
|
||||||
# https://github.com/bazelbuild/rules_swift
|
# https://github.com/bazelbuild/rules_swift
|
||||||
# If enabled the skip function bodies frontend flag is passed when using derived
|
# If enabled the skip function bodies frontend flag is passed when using derived
|
||||||
# files generation.
|
# files generation.
|
||||||
@ -112,11 +107,25 @@ class BazelCommandLine:
|
|||||||
def set_build_number(self, build_number):
|
def set_build_number(self, build_number):
|
||||||
self.build_number = build_number
|
self.build_number = build_number
|
||||||
|
|
||||||
|
def set_split_swiftmodules(self, value):
|
||||||
|
self.split_submodules = value
|
||||||
|
|
||||||
def set_configuration_path(self, path):
|
def set_configuration_path(self, path):
|
||||||
self.configuration_path = path
|
self.configuration_path = path
|
||||||
|
|
||||||
def set_configuration(self, configuration):
|
def set_configuration(self, configuration):
|
||||||
if configuration == 'debug_arm64':
|
if configuration == 'debug_universal':
|
||||||
|
self.configuration_args = [
|
||||||
|
# bazel debug build configuration
|
||||||
|
'-c', 'dbg',
|
||||||
|
|
||||||
|
# Build universal binaries.
|
||||||
|
'--ios_multi_cpus=armv7,arm64',
|
||||||
|
|
||||||
|
# Always build universal Watch binaries.
|
||||||
|
'--watchos_cpus=armv7k,arm64_32'
|
||||||
|
] + self.common_debug_args
|
||||||
|
elif configuration == 'debug_arm64':
|
||||||
self.configuration_args = [
|
self.configuration_args = [
|
||||||
# bazel debug build configuration
|
# bazel debug build configuration
|
||||||
'-c', 'dbg',
|
'-c', 'dbg',
|
||||||
@ -151,6 +160,23 @@ class BazelCommandLine:
|
|||||||
# Generate DSYM files when building.
|
# Generate DSYM files when building.
|
||||||
'--apple_generate_dsym',
|
'--apple_generate_dsym',
|
||||||
|
|
||||||
|
# Require DSYM files as build output.
|
||||||
|
'--output_groups=+dsyms'
|
||||||
|
] + self.common_release_args
|
||||||
|
elif configuration == 'release_armv7':
|
||||||
|
self.configuration_args = [
|
||||||
|
# bazel optimized build configuration
|
||||||
|
'-c', 'opt',
|
||||||
|
|
||||||
|
# Build single-architecture binaries. It is almost 2 times faster is 32-bit support is not required.
|
||||||
|
'--ios_multi_cpus=armv7',
|
||||||
|
|
||||||
|
# Always build universal Watch binaries.
|
||||||
|
'--watchos_cpus=armv7k,arm64_32',
|
||||||
|
|
||||||
|
# Generate DSYM files when building.
|
||||||
|
'--apple_generate_dsym',
|
||||||
|
|
||||||
# Require DSYM files as build output.
|
# Require DSYM files as build output.
|
||||||
'--output_groups=+dsyms'
|
'--output_groups=+dsyms'
|
||||||
] + self.common_release_args
|
] + self.common_release_args
|
||||||
@ -217,6 +243,19 @@ class BazelCommandLine:
|
|||||||
|
|
||||||
return combined_arguments
|
return combined_arguments
|
||||||
|
|
||||||
|
def get_additional_build_arguments(self):
|
||||||
|
combined_arguments = []
|
||||||
|
if self.split_submodules:
|
||||||
|
combined_arguments += [
|
||||||
|
# https://github.com/bazelbuild/rules_swift
|
||||||
|
# If enabled and whole module optimisation is being used, the `*.swiftdoc`,
|
||||||
|
# `*.swiftmodule` and `*-Swift.h` are generated with a separate action
|
||||||
|
# rather than as part of the compilation.
|
||||||
|
'--features=swift.split_derived_files_generation',
|
||||||
|
]
|
||||||
|
|
||||||
|
return combined_arguments
|
||||||
|
|
||||||
def invoke_build(self):
|
def invoke_build(self):
|
||||||
combined_arguments = [
|
combined_arguments = [
|
||||||
self.build_environment.bazel_path
|
self.build_environment.bazel_path
|
||||||
@ -237,6 +276,7 @@ class BazelCommandLine:
|
|||||||
combined_arguments += self.common_args
|
combined_arguments += self.common_args
|
||||||
combined_arguments += self.common_build_args
|
combined_arguments += self.common_build_args
|
||||||
combined_arguments += self.get_define_arguments()
|
combined_arguments += self.get_define_arguments()
|
||||||
|
combined_arguments += self.get_additional_build_arguments()
|
||||||
|
|
||||||
if self.remote_cache is not None:
|
if self.remote_cache is not None:
|
||||||
combined_arguments += [
|
combined_arguments += [
|
||||||
@ -355,6 +395,8 @@ def build(arguments):
|
|||||||
bazel_command_line.set_configuration(arguments.configuration)
|
bazel_command_line.set_configuration(arguments.configuration)
|
||||||
bazel_command_line.set_build_number(arguments.buildNumber)
|
bazel_command_line.set_build_number(arguments.buildNumber)
|
||||||
|
|
||||||
|
bazel_command_line.set_split_swiftmodules(not arguments.disableParallelSwiftmoduleGeneration)
|
||||||
|
|
||||||
bazel_command_line.invoke_build()
|
bazel_command_line.invoke_build()
|
||||||
|
|
||||||
|
|
||||||
@ -497,14 +539,22 @@ if __name__ == '__main__':
|
|||||||
buildParser.add_argument(
|
buildParser.add_argument(
|
||||||
'--configuration',
|
'--configuration',
|
||||||
choices=[
|
choices=[
|
||||||
|
'debug_universal',
|
||||||
'debug_arm64',
|
'debug_arm64',
|
||||||
'debug_armv7',
|
'debug_armv7',
|
||||||
'release_arm64',
|
'release_arm64',
|
||||||
|
'release_armv7',
|
||||||
'release_universal'
|
'release_universal'
|
||||||
],
|
],
|
||||||
required=True,
|
required=True,
|
||||||
help='Build configuration'
|
help='Build configuration'
|
||||||
)
|
)
|
||||||
|
buildParser.add_argument(
|
||||||
|
'--disableParallelSwiftmoduleGeneration',
|
||||||
|
action='store_true',
|
||||||
|
default=False,
|
||||||
|
help='Generate .swiftmodule files in parallel to building modules, can speed up compilation on multi-core systems.'
|
||||||
|
)
|
||||||
|
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
|
@ -9,3 +9,6 @@ telegram_is_appstore_build = "true"
|
|||||||
telegram_appstore_id = "686449807"
|
telegram_appstore_id = "686449807"
|
||||||
telegram_app_specific_url_scheme = "tg"
|
telegram_app_specific_url_scheme = "tg"
|
||||||
telegram_aps_environment = "production"
|
telegram_aps_environment = "production"
|
||||||
|
telegram_enable_siri = True
|
||||||
|
telegram_enable_icloud = True
|
||||||
|
telegram_enable_watch = True
|
@ -104,7 +104,7 @@ final class WidgetDataContext {
|
|||||||
let queue = Queue()
|
let queue = Queue()
|
||||||
let updatedAdditionalPeerIds: Signal<[AccountRecordId: Set<PeerId>], NoError> = Signal { subscriber in
|
let updatedAdditionalPeerIds: Signal<[AccountRecordId: Set<PeerId>], NoError> = Signal { subscriber in
|
||||||
if #available(iOSApplicationExtension 14.0, iOS 14.0, *) {
|
if #available(iOSApplicationExtension 14.0, iOS 14.0, *) {
|
||||||
#if arch(arm64) || arch(i386) || arch(x86_64)
|
#if arch(arm64) || arch(x86_64)
|
||||||
WidgetCenter.shared.getCurrentConfigurations { result in
|
WidgetCenter.shared.getCurrentConfigurations { result in
|
||||||
var peerIds: [AccountRecordId: Set<PeerId>] = [:]
|
var peerIds: [AccountRecordId: Set<PeerId>] = [:]
|
||||||
|
|
||||||
|
1
third-party/webrtc/BUILD
vendored
1
third-party/webrtc/BUILD
vendored
@ -3174,6 +3174,7 @@ common_arm_specific_sources = [webrtc_source_dir + "/" + path for path in [
|
|||||||
armv7_specific_sources = [webrtc_source_dir + "/" + path for path in [
|
armv7_specific_sources = [webrtc_source_dir + "/" + path for path in [
|
||||||
"common_audio/signal_processing/filter_ar_fast_q12.c",
|
"common_audio/signal_processing/filter_ar_fast_q12.c",
|
||||||
"common_audio/signal_processing/complex_bit_reverse.c",
|
"common_audio/signal_processing/complex_bit_reverse.c",
|
||||||
|
"common_audio/third_party/ooura/fft_size_128/ooura_fft_neon.cc",
|
||||||
]]
|
]]
|
||||||
|
|
||||||
arm64_specific_sources = [webrtc_source_dir + "/" + path for path in [
|
arm64_specific_sources = [webrtc_source_dir + "/" + path for path in [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user