TelegramMessenger / Telegram-iOS
- понедельник, 18 января 2021 г. в 00:26:18
Swift
Telegram-iOS
We welcome all developers to use our API and source code to create applications on our platform. There are several things we require from all developers for the moment.
git clone --recursive -j8 https://github.com/TelegramMessenger/Telegram-iOS.git
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
mkdir -p $HOME/telegram-configuration
cp -R build-system/example-configuration/* $HOME/telegram-configuration/
variables.bzl
provisioning
with valid filesmkdir -p "$HOME/telegram-bazel-cache"
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
python3 build-system/Make/Make.py \
--bazel="$HOME/bazel-dist/bazel" \
--cacheDir="$HOME/telegram-bazel-cache" \
generateProject \
--configurationPath="$HOME/telegram-configuration" \
--disableExtensions
It is possible to generate a project that does not require any codesigning certificates to be installed: add --disableProvisioningProfiles
flag:
python3 build-system/Make/Make.py \
--bazel="$HOME/bazel-dist/bazel" \
--cacheDir="$HOME/telegram-bazel-cache" \
generateProject \
--configurationPath="$HOME/telegram-configuration" \
--disableExtensions \
--disableProvisioningProfiles
Tip: use --disableExtensions
when developing to speed up development by not building application extensions and the WatchOS app.
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