Skip to content

Commit

Permalink
Release 1.3.0 (125)
Browse files Browse the repository at this point in the history
  • Loading branch information
denis15yo committed May 24, 2023
1 parent 8cdfb12 commit 1e14328
Show file tree
Hide file tree
Showing 502 changed files with 118,991 additions and 85,764 deletions.
3 changes: 0 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,3 @@ build --spawn_strategy=standalone
build --strategy=SwiftCompile=standalone
build --define RULES_SWIFT_BUILD_DUMMY_WORKER=1

#build --linkopt=-fuse-ld=/Users/ali/Downloads/ld64.lld
#build --linkopt=-fuse-ld=/Users/ali/build/zld/build/Build/Products/Release/zld
#build --linkopt=-Wl,-zld_original_ld_path,__BAZEL_XCODE_DEVELOPER_DIR__/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ bazel-telegram-ios
bazel-telegram-ios/*
bazel-testlogs
bazel-testlogs/*
xcodeproj.bazelrc
*/*.swp
*.swp
build-input/*
Expand Down
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ stages:
- deploy
- verifysanity
- verify
- submit

variables:
LANG: "en_US.UTF-8"
Expand Down Expand Up @@ -157,3 +158,14 @@ verify_beta_testflight:
paths:
- build/artifacts
expire_in: 1 week

submit_appstore:
tags:
- deploy
stage: submit
needs: []
when: manual
script:
- sh "$TELEGRAM_SUBMIT_BUILD"
environment:
name: testflight_llc
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
url = https://github.com/bazelbuild/rules_swift.git
[submodule "build-system/bazel-rules/apple_support"]
path = build-system/bazel-rules/apple_support
url = https://github.com/bazelbuild/apple_support.git
url = https://github.com/ali-fareed/apple_support.git
[submodule "submodules/TgVoip/libtgvoip"]
path = submodules/TgVoip/libtgvoip
url = https://github.com/telegramdesktop/libtgvoip.git
Expand All @@ -28,3 +28,6 @@
[submodule "third-party/libx264/x264"]
path = third-party/libx264/x264
url = https://github.com/mirror/x264.git
[submodule "build-system/bazel-rules/rules_xcodeproj"]
path = build-system/bazel-rules/rules_xcodeproj
url = https://github.com/MobileNativeFoundation/rules_xcodeproj.git
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,10 @@ class QuickReplyItemNode: ItemListRevealOptionsItemNode, ItemListItemNode, ItemL
self.textNode.becomeFirstResponder()
}

func selectAll() {
self.textNode.textView.selectAll(nil)
}

override func isReorderable(at point: CGPoint) -> Bool {
if self.reorderControlNode.frame.contains(point), !self.reorderControlNode.isHidden, !self.isDisplayingRevealedOptions {
return true
Expand Down
6 changes: 3 additions & 3 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"location" : "https://github.com/denis15yo/GRDB.swift.git",
"state" : {
"branch" : "master",
"revision" : "655570181518ac25f7efccb83d50f86c82ee5ac5"
"revision" : "58d3673030f8a640d7278f45bf2dc21b078ecae8"
}
},
{
Expand All @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/SDWebImage/SDWebImage.git",
"state" : {
"revision" : "3289629ef6cbf1ad8c3d1dccf0cf09ac97547cd6",
"version" : "5.15.7"
"revision" : "7f9fb5d43ecd4aa714c00746f54873f354403438",
"version" : "5.15.8"
}
},
{
Expand Down
85 changes: 42 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,86 +11,85 @@ There are several things we require from **all developers** for the moment.
3. Please study our [**security guidelines**](https://core.telegram.org/mtproto/security_guidelines) and take good care of your users' data and privacy.
4. Please remember to publish **your** code too in order to comply with the licences.

# Compilation Guide
# Quick Compilation Guide

1. Install Xcode (directly from https://developer.apple.com/download/more or using the App Store).
2. Clone the project from GitHub:
## Get the Code

```
git clone --recursive -j8 https://github.com/TelegramMessenger/Telegram-iOS.git
```

3. Adjust configuration parameters
## Setup Xcode

```
mkdir -p $HOME/telegram-configuration
mkdir -p $HOME/telegram-provisioning
cp build-system/appstore-configuration.json $HOME/telegram-configuration/configuration.json
cp -R build-system/fake-codesigning $HOME/telegram-provisioning/
```
Install Xcode (directly from https://developer.apple.com/download/applications or using the App Store).

- Modify the values in `configuration.json`
- Replace the provisioning profiles in `profiles` with valid files

4. (Optional) Create a build cache directory to speed up rebuilds
## Adjust Configuration

1. Generate a random identifier:
```
mkdir -p "$HOME/telegram-bazel-cache"
openssl rand -hex 8
```
2. Create a new Xcode project. Use `Telegram` as the Product Name. Use `org.{identifier from step 1}` as the Organization Identifier.
3. Open `Keychain Access` and navigate to `Certificates`. Locate `Apple Development: [email protected] (XXXXXXXXXX)` and double tap the certificate. Under `Details`, locate `Organizational Unit`. This is the Team ID.
4. Edit `build-system/template_minimal_development_configuration.json`. Use data from the previous steps.

5. Build the app
## Generate an Xcode project

```
python3 build-system/Make/Make.py \
--cacheDir="$HOME/telegram-bazel-cache" \
build \
--configurationPath=path-to-configuration.json \
--codesigningInformationPath=path-to-provisioning-data \
--buildNumber=100001 \
--configuration=release_universal
generateProject \
--configurationPath=build-system/template_minimal_development_configuration.json \
--xcodeManagedCodesigning
```

6. (Optional) Generate an Xcode project
# Advanced Compilation Guide

## Xcode

1. Copy and edit `build-system/appstore-configuration.json`.
2. Copy `build-system/fake-codesigning`. Create and download provisioning profiles, using the `profiles` folder as a reference for the entitlements.
3. Generate an Xcode project:
```
python3 build-system/Make/Make.py \
--cacheDir="$HOME/telegram-bazel-cache" \
generateProject \
--configurationPath=path-to-configuration.json \
--codesigningInformationPath=path-to-provisioning-data \
--disableExtensions
--configurationPath=configuration_from_step_1.json \
--codesigningInformationPath=directory_from_step_2
```

It is possible to generate a project that does not require any codesigning certificates to be installed: add `--disableProvisioningProfiles` flag:
## IPA

1. Repeat the steps from the previous section. Use distribution provisioning profiles.
2. Run:
```
python3 build-system/Make/Make.py \
--cacheDir="$HOME/telegram-bazel-cache" \
generateProject \
--configurationPath=path-to-configuration.json \
--codesigningInformationPath=path-to-provisioning-data \
--disableExtensions \
--disableProvisioningProfiles
build \
--configurationPath=...see previous section... \
--codesigningInformationPath=...see previous section... \
--buildNumber=100001 \
--configuration=release_arm64
```

## Tips

Tip: use `--disableExtensions` when developing to speed up development by not building application extensions and the WatchOS app.


# Tips

Bazel is used to build the app. To simplify the development setup a helper script is provided (`build-system/Make/Make.py`). See help:
## Codesigning is not required for simulator-only builds

Add `--disableProvisioningProfiles`:
```
python3 build-system/Make/Make.py --help
python3 build-system/Make/Make.py build --help
python3 build-system/Make/Make.py generateProject --help
python3 build-system/Make/Make.py \
--cacheDir="$HOME/telegram-bazel-cache" \
generateProject \
--configurationPath=path-to-configuration.json \
--codesigningInformationPath=path-to-provisioning-data \
--disableProvisioningProfiles
```

Bazel is automatically downloaded when running Make.py for the first time. If you wish to use your own build of Bazel, pass `--bazel=path-to-bazel`. If your Bazel version differs from that in `versions.json`, you may use `--overrideBazelVersion` to skip the version check.
## Versions

Each release is built using specific Xcode and Bazel versions (see `versions.json`). The helper script checks the versions of installed software and reports an error if they don't match the ones specified in `versions.json`. There are flags that allow to bypass these checks:
Each release is built using a specific Xcode version (see `versions.json`). The helper script checks the versions of the installed software and reports an error if they don't match the ones specified in `versions.json`. It is possible to bypass these checks:

```
python3 build-system/Make/Make.py --overrideBazelVersion build ... # Don't check the version of Bazel
python3 build-system/Make/Make.py --overrideXcodeVersion build ... # Don't check the version of Xcode
```
108 changes: 52 additions & 56 deletions Telegram/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,24 @@ load("@build_bazel_rules_swift//swift:swift.bzl",
"swift_library",
)

load(
"@rules_xcodeproj//xcodeproj:defs.bzl",
"top_level_target",
"top_level_targets",
"xcodeproj",
"xcode_provisioning_profile",
)

load("@build_bazel_rules_apple//apple:apple.bzl", "local_provisioning_profile")

load("//build-system/bazel-utils:plist_fragment.bzl",
"plist_fragment",
)

load(
"@build_configuration//:variables.bzl",
"telegram_bazel_path",
"telegram_use_xcode_managed_codesigning",
"telegram_bundle_id",
"telegram_aps_environment",
"telegram_team_id",
Expand Down Expand Up @@ -538,10 +550,11 @@ app_groups_fragment = """
telegram_bundle_id=telegram_bundle_id
)

communication_notifications_fragment = """
official_communication_notifications_fragment = """
<key>com.apple.developer.usernotifications.communication</key>
<true/>
"""
communication_notifications_fragment = official_communication_notifications_fragment if telegram_bundle_id in official_bundle_ids else ""

filtering_notifications_fragment = """
<key>com.apple.developer.usernotifications.filtering</key>
Expand Down Expand Up @@ -1079,29 +1092,6 @@ plist_fragment(
)
)

ios_framework(
name = "AsyncDisplayKitFramework",
bundle_id = "{telegram_bundle_id}.AsyncDisplayKit".format(
telegram_bundle_id = telegram_bundle_id,
),
families = [
"iphone",
"ipad",
],
infoplists = [
":AsyncDisplayKitInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
":RequiredDeviceCapabilitiesPlist",
],
minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
],
)

plist_fragment(
name = "DisplayInfoPlist",
extension = "plist",
Expand Down Expand Up @@ -1163,33 +1153,6 @@ sh_binary(
srcs = [":GenerateAddAlternateIcons"],
)

ios_framework(
name = "DisplayFramework",
bundle_id = "{telegram_bundle_id}.Display".format(
telegram_bundle_id = telegram_bundle_id,
),
families = [
"iphone",
"ipad",
],
infoplists = [
":DisplayInfoPlist",
":BuildNumberInfoPlist",
":VersionInfoPlist",
":RequiredDeviceCapabilitiesPlist",
],
frameworks = [
":SwiftSignalKitFramework",
":AsyncDisplayKitFramework",
],
minimum_os_version = minimum_os_version,
extension_safe = True,
ipa_post_processor = strip_framework,
deps = [
"//submodules/Display:Display",
],
)

plist_fragment(
name = "TelegramUIInfoPlist",
extension = "plist",
Expand Down Expand Up @@ -1228,8 +1191,6 @@ ios_framework(
":SwiftSignalKitFramework",
":PostboxFramework",
":TelegramCoreFramework",
":AsyncDisplayKitFramework",
":DisplayFramework",
],
minimum_os_version = minimum_os_version,
extension_safe = True,
Expand Down Expand Up @@ -2033,6 +1994,18 @@ plist_fragment(
)
)

local_provisioning_profile(
name = "Telegram_local_profile",
profile_name = "iOS Team Provisioning Profile: {}".format(telegram_bundle_id),
team_id = telegram_team_id,
)

xcode_provisioning_profile(
name = "Telegram_xcode_profile",
managed_by_xcode = True,
provisioning_profile = ":Telegram_local_profile",
)

ios_application(
name = "Telegram",
bundle_id = "{telegram_bundle_id}".format(
Expand All @@ -2042,7 +2015,7 @@ ios_application(
minimum_os_version = minimum_os_version,
provisioning_profile = select({
":disableProvisioningProfilesSetting": None,
"//conditions:default": "@build_configuration//provisioning:Telegram.mobileprovision",
"//conditions:default": ":Telegram_xcode_profile" if telegram_use_xcode_managed_codesigning else "@build_configuration//provisioning:Telegram.mobileprovision",
}),
entitlements = ":TelegramEntitlements.entitlements",
infoplists = [
Expand All @@ -2066,8 +2039,6 @@ ios_application(
":SwiftSignalKitFramework",
":PostboxFramework",
":TelegramCoreFramework",
":AsyncDisplayKitFramework",
":DisplayFramework",
":TelegramUIFramework",
],
settings_bundle = "//Nicegram/NGSettingsBundle:NGSettingsBundle",
Expand All @@ -2093,6 +2064,31 @@ ios_application(
":Main",
":Lib",
],
visibility = ["//visibility:public"],
)

xcodeproj(
name = "Telegram_xcodeproj",
build_mode = "bazel",
bazel_path = telegram_bazel_path,
project_name = "Telegram",
tags = ["manual"],
top_level_targets = top_level_targets(
labels = [
":Telegram",
],
target_environments = ["device", "simulator"],
),
xcode_configurations = {
"Debug": {
"//command_line_option:compilation_mode": "dbg",
},
"Release": {
"//command_line_option:compilation_mode": "opt",
},
},
default_xcode_configuration = "Debug"

)

# Temporary targets used to simplify webrtc build tests
Expand Down
Loading

0 comments on commit 1e14328

Please sign in to comment.