Telegram-iOS
Find a file
2021-01-15 12:17:36 +04:00
.github/ISSUE_TEMPLATE Bump app version in bug report template [skip ci] 2020-08-08 09:06:44 +03:00
build-system Fix build instructions 2021-01-15 01:42:30 +04:00
buildbox Apply sticker thumbnail fixes 2021-01-15 00:52:08 +04:00
Config Apply sticker thumbnail fixes 2021-01-15 00:52:08 +04:00
submodules Apply sticker thumbnail fixes 2021-01-15 00:52:08 +04:00
Telegram Apply sticker thumbnail fixes 2021-01-15 00:52:08 +04:00
third-party Apply sticker thumbnail fixes 2021-01-15 00:52:08 +04:00
tools Apply sticker thumbnail fixes 2021-01-15 00:52:08 +04:00
.bazelrc WIP 2020-11-26 19:10:53 +04:00
.buckconfig Fix passcode layout 2019-11-04 19:44:25 +04:00
.gitattributes Add linguist overrides for vendored code 2019-10-06 09:37:09 +03:00
.gitignore WIP 2020-10-28 18:52:39 +04:00
.gitlab-ci.yml Always upload artifacts 2020-12-08 11:19:18 +04:00
.gitmodules Update tulsi URL 2020-12-09 21:52:30 +04:00
Changelog-beta.txt Merge commit '7ff263736c' 2019-07-10 14:50:54 +04:00
check_env.sh Temp 2019-08-30 23:32:32 +04:00
clean.sh Temp 2019-08-18 23:07:18 +03:00
extract_wallet_source.py Wallet-related changes 2020-04-01 21:56:51 +04:00
Makefile Bump version 2020-12-23 21:13:21 +04:00
package_app.sh Merge commit 'e9a4a9347a' into bazel 2020-03-01 19:10:10 +04:00
Random.txt Trigger build 2020-11-27 16:00:47 +04:00
README.md Fix spelling 2021-01-15 12:17:36 +04:00
Utils.makefile Build with bazel on CI 2020-10-29 01:15:17 +04:00
versions.json Apply sticker thumbnail fixes 2021-01-15 00:52:08 +04:00
WORKSPACE Update build utils 2020-12-09 21:42:00 +04:00

Telegram iOS Source Code Compilation Guide

  1. Install Xcode (directly from https://developer.apple.com/download/more or using the App Store).
  2. Clone the project from GitHub:
git clone --recursive https://github.com/TelegramMessenger/Telegram-iOS.git
  1. Download Bazel 3.7.0
mkdir -p $HOME/bazel-dist
cd $HOME/bazel-dist
curl -O -L https://github.com/bazelbuild/bazel/releases/download/3.7.0/bazel-3.7.0-darwin-x86_64
mv bazel-3.7.0* bazel

Verify that it's working

chmod +x bazel
bazel --version
  1. Adjust configuration parameters
mkdir -p $HOME/telegram-configuration
cp -R build-system/example-configuration/* $HOME/telegram-configuration/
  • Modify the values in variables.bzl
  • Replace the provisioning profiles in provisioning with valid files
  1. (Optional) Create a build cache directory to speed up rebuilds
mkdir -p "$HOME/telegram-bazel-cache"
  1. Build the app
python3 build-system/Make/Make.py \
    --bazel="$HOME/bazel-dist/bazel" \
    --cacheDir="$HOME/telegram-bazel-cache" \
    build \
    --configurationPath="$HOME/telegram-configuration" \
    --buildNumber=100001 \
    --configuration=release_universal
  1. (Optional) Generate an Xcode project
python3 build-system/Make/Make.py \
    --bazel="$HOME/bazel-dist/bazel" \
    --cacheDir="$HOME/telegram-bazel-cache" \
    generateProject \
    --configurationPath="$HOME/telegram-configuration" \
    --disableExtensions

Tip: use --disableExtensions when developing to speed up development by not building application extensions.

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:

python3 build-system/Make/Make.py --help
python3 build-system/Make/Make.py build --help
python3 build-system/Make/Make.py generateProject --help

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:

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