Skip to content

Commit 8421906

Browse files
committed
Connect to NativeLink Cloud
0 parents  commit 8421906

File tree

23,473 files changed

+6133487
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

23,473 files changed

+6133487
-0
lines changed

.bazelrc

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
build --action_env=ZERO_AR_DATE=1
2+
3+
build --apple_platform_type=ios
4+
build --enable_platform_specific_config
5+
build --apple_crosstool_top=@local_config_apple_cc//:toolchain
6+
build --crosstool_top=@local_config_apple_cc//:toolchain
7+
build --host_crosstool_top=@local_config_apple_cc//:toolchain
8+
9+
build --cxxopt='-std=c++17'
10+
build --per_file_copt="third-party/webrtc/.*\.cpp$","@-std=c++17"
11+
build --per_file_copt="third-party/webrtc/.*\.cc$","@-std=c++17"
12+
build --per_file_copt="third-party/webrtc/.*\.mm$","@-std=c++17"
13+
build --per_file_copt="submodules/LottieMeshSwift/LottieMeshBinding/Sources/.*\.mm$","@-std=c++17"
14+
build --per_file_copt="submodules/LottieCpp/lottiecpp/Sources/.*\.mm$","@-std=c++17"
15+
build --per_file_copt="submodules/LottieCpp/lottiecpp/Sources/.*\.cpp$","@-std=c++17"
16+
build --per_file_copt="submodules/LottieCpp/lottiecpp/PlatformSpecific/Darwin/Sources/.*\.mm$","@-std=c++17"
17+
build --per_file_copt="submodules/LottieCpp/lottiecpp/PlatformSpecific/Darwin/Sources/.*\.cpp$","@-std=c++17"
18+
build --per_file_copt="Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/.*\.cpp$","@-std=c++17"
19+
build --per_file_copt="Tests/LottieMetalTest/SoftwareLottieRenderer/Sources/.*\.mm$","@-std=c++17"
20+
21+
build --swiftcopt=-whole-module-optimization
22+
23+
build --per_file_copt=".*\.m$","@-fno-objc-msgsend-selector-stubs"
24+
build --per_file_copt=".*\.mm$","@-fno-objc-msgsend-selector-stubs"
25+
26+
#build --linkopt="-ld_classic"
27+
28+
build --features=debug_prefix_map_pwd_is_dot
29+
build --features=swift.cacheable_swiftmodules
30+
build --features=swift.debug_prefix_map
31+
build --features=swift.enable_vfsoverlays
32+
33+
build --strategy=Genrule=standalone
34+
build --spawn_strategy=standalone
35+
36+
build --strategy=SwiftCompile=standalone
37+
build --define RULES_SWIFT_BUILD_DUMMY_WORKER=1
38+
39+
build --noenable_bzlmod
40+
41+
# Please contact Blake Hatch for a link to the organization in NativeLink Cloud
42+
build --remote_cache=grpcs://cas-blake.build-faster.nativelink.net
43+
build --remote_header=x-nativelink-api-key=[INSERT_TELEGRAM_DEMO_ORG_API_KEY]
44+
build --bes_backend=grpcs://bes-blake.build-faster.nativelink.net
45+
build --bes_header=x-nativelink-api-key=[INSERT_TELEGRAM_DEMO_ORG_API_KEY]
46+
build --bes_results_url=https://app.nativelink.com/894549e1-0dc3-4b83-bfb2-56065d4fe642/build
47+
build --remote_timeout=600

.gitattributes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Linguist overrides for vendored code
2+
submodules/AsyncDisplayKit/* linguist-vendored
3+
submodules/ffmpeg/* linguist-vendored
4+
submodules/HockeySDK-iOS/* linguist-vendored
5+
submodules/libphonenumber/* linguist-vendored
6+
submodules/libtgvoip/* linguist-vendored
7+
submodules/lottie-ios/* linguist-vendored
8+
submodules/Opus/* linguist-vendored
9+
submodules/OpusBinding/* linguist-vendored
10+
submodules/rlottie/rlottie/* linguist-vendored
11+
submodules/sqlcipher/* linguist-vendored
12+
submodules/Stripe/* linguist-vendored
13+
submodules/ton/tonlib-src/* linguist-vendored
14+
submodules/webp/include/* linguist-vendored
15+
third-party/* linguist-vendored

.github/CONTRIBUTING.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Contributing
2+
3+
This document describes how you can contribute to Telegram-iOS. Please read it carefully.
4+
5+
**Table of Contents**
6+
7+
* [What contributions are accepted](#what-contributions-are-accepted)
8+
* [Build instructions](#build-instructions)
9+
* [Pull upstream changes into your fork regularly](#pull-upstream-changes-into-your-fork-regularly)
10+
* [How to get your pull request accepted](#how-to-get-your-pull-request-accepted)
11+
* [Keep your pull requests limited to a single issue](#keep-your-pull-requests-limited-to-a-single-issue)
12+
* [Squash your commits to a single commit](#squash-your-commits-to-a-single-commit)
13+
* [Don't mix code changes with whitespace cleanup](#dont-mix-code-changes-with-whitespace-cleanup)
14+
* [Keep your code simple!](#keep-your-code-simple)
15+
* [Test your changes!](#test-your-changes)
16+
* [Write a good commit message](#write-a-good-commit-message)
17+
18+
## What contributions are accepted
19+
20+
We highly appreciate your contributions in the matter of fixing bugs and optimizing the Telegram-iOS source code and its documentation. In case of fixing the existing user experience please push to your fork and [submit a pull request][pr].
21+
22+
Wait for us. We try to review your pull requests as fast as possible.
23+
If we find issues with your pull request, we may suggest some changes and improvements.
24+
25+
Unfortunately we **do not merge** any pull requests that have new feature implementations, translations to new languages and those which introduce any new user interface elements.
26+
27+
If you have a translations-related contribution, check out [Translations platform][translate].
28+
29+
Telegram-iOS is not a standalone application but a part of [Telegram project][telegram], so all the decisions about the features, languages, user experience, user interface and the design are made inside Telegram team, often according to some roadmap which is not public.
30+
31+
## Build instructions
32+
33+
See the [README.md][build_instructions] for details on the various build
34+
environments.
35+
36+
## Pull upstream changes into your fork regularly
37+
38+
Telegram-iOS is advancing quickly. It is therefore critical that you pull upstream changes into your fork on a regular basis. Nothing is worse than putting in a days of hard work into a pull request only to have it rejected because it has diverged too far from upstream.
39+
40+
To pull in upstream changes:
41+
42+
git remote add upstream https://github.com/TelegramMessenger/Telegram-iOS.git
43+
git fetch upstream master
44+
45+
Check the log to be sure that you actually want the changes, before merging:
46+
47+
git log upstream/master
48+
49+
Then rebase your changes on the latest commits in the `master` branch:
50+
51+
git rebase upstream/master
52+
53+
After that, you have to force push your commits:
54+
55+
git push --force
56+
57+
For more info, see [GitHub Help][help_fork_repo].
58+
59+
## How to get your pull request accepted
60+
61+
We want to improve Telegram-iOS with your contributions. But we also want to provide a stable experience for our users and the community. Follow these rules and you should succeed without a problem!
62+
63+
### Keep your pull requests limited to a single issue
64+
65+
Pull requests should be as small/atomic as possible. Large, wide-sweeping changes in a pull request will be **rejected**, with comments to isolate the specific code in your pull request. Some examples:
66+
67+
* If you are making spelling corrections in the docs, don't modify other files.
68+
* If you are adding new functions don't '*cleanup*' unrelated functions. That cleanup belongs in another pull request.
69+
70+
#### Squash your commits to a single commit
71+
72+
To keep the history of the project clean, you should make one commit per pull request.
73+
If you already have multiple commits, you can add the commits together (squash them) with the following commands in Git Bash:
74+
75+
1. Open `Git Bash` (or `Git Shell`)
76+
2. Enter following command to squash the recent {N} commits: `git reset --soft HEAD~{N} && git commit` (replace `{N}` with the number of commits you want to squash)
77+
3. Press <kbd>i</kbd> to get into Insert-mode
78+
4. Enter the commit message of the new commit
79+
5. After adding the message, press <kbd>ESC</kbd> to get out of the Insert-mode
80+
6. Write `:wq` and press <kbd>Enter</kbd> to save the new message or write `:q!` to discard your changes
81+
7. Enter `git push --force` to push the new commit to the remote repository
82+
83+
For example, if you want to squash the last 5 commits, use `git reset --soft HEAD~5 && git commit`
84+
85+
### Don't mix code changes with whitespace cleanup
86+
87+
If you change two lines of code and correct 200 lines of whitespace issues in a file the diff on that pull request is functionally unreadable and will be **rejected**. Whitespace cleanups need to be in their own pull request.
88+
89+
### Keep your code simple!
90+
91+
Please keep your code as clean and straightforward as possible.
92+
Furthermore, the pixel shortage is over. We want to see:
93+
94+
* `opacity` instead of `o`
95+
* `placeholder` instead of `ph`
96+
* `myFunctionThatDoesThings()` instead of `mftdt()`
97+
98+
### Test your changes!
99+
100+
Before you submit a pull request, please test your changes. Verify that Telegram-iOS still works and your changes don't cause other issue or crashes.
101+
102+
### Write a good commit message
103+
104+
* Explain why you make the changes. [More infos about a good commit message.][commit_message]
105+
106+
* If you fix an issue with your commit, please close the issue by [adding one of the keywords and the issue number][closing-issues-via-commit-messages] to your commit message.
107+
108+
For example: `Fix #545`
109+
110+
[//]: # (LINKS)
111+
[telegram]: https://telegram.org/
112+
[help_fork_repo]: https://help.github.com/articles/fork-a-repo/
113+
[help_change_commit_message]: https://help.github.com/articles/changing-a-commit-message/
114+
[commit_message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
115+
[pr]: https://github.com/TelegramMessenger/Telegram-iOS/compare
116+
[build_instructions]: https://github.com/TelegramMessenger/Telegram-iOS#quick-compilation-guide
117+
[closing-issues-via-commit-messages]: https://help.github.com/articles/closing-issues-via-commit-messages/
118+
[translate]: https://translations.telegram.org
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: "\U0001F41E Bug Report"
3+
about: "Report a bug if something isn't working as expected in Telegram Messenger for iOS."
4+
title: ""
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
<!-- Thanks for reporting issues of Telegram Messenger for iOS!
10+
This is a bug report template. Please, be as descriptive as possible. Issues lacking detail, or for any other reason than to report a bug, may be closed without action.
11+
12+
First, complete the checklist by replacing the empty checkboxes [] with checked ones [x]. -->
13+
14+
### Checklist
15+
- [ ] I am reporting an issue in existing functionality that does not work as intended
16+
- [ ] I've searched for existing [GitHub issues](https://github.com/telegrammessenger/Telegram-iOS/issues)
17+
18+
### Description
19+
Describe the issue that you are experiencing
20+
21+
### Expected Behavior
22+
Tell us what should happen
23+
24+
### Actual Behavior
25+
Tell us what happens instead
26+
27+
### Steps to Reproduce
28+
1.
29+
2.
30+
3.
31+
32+
### Screenshots and Videos
33+
Remove, if not applicable
34+
35+
### Environment
36+
**Device:** `iPhone/iPad X`
37+
38+
**iOS version**: `13.X`
39+
40+
**App version:** `7.X`

.github/workflows/build.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: macos-13
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
submodules: 'recursive'
17+
fetch-depth: '0'
18+
19+
- name: Set active Xcode path
20+
run: |
21+
XCODE_VERSION=$(cat versions.json | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["xcode"]);')
22+
sudo xcode-select -s /Applications/Xcode_$XCODE_VERSION.app/Contents/Developer
23+
24+
- name: Create canonical source directory
25+
run: |
26+
set -x
27+
sudo mkdir -p /Users/Shared
28+
cp -R $GITHUB_WORKSPACE /Users/Shared/
29+
mv /Users/Shared/$(basename $GITHUB_WORKSPACE) /Users/Shared/telegram-ios
30+
31+
- name: Build the App
32+
run: |
33+
set -x
34+
35+
# source code paths are included in the final binary, so we need to make them stable across builds
36+
SOURCE_DIR=/Users/Shared/telegram-ios
37+
38+
# use canonical bazel root
39+
BAZEL_USER_ROOT="/private/var/tmp/_bazel_containerhost"
40+
41+
cd $SOURCE_DIR
42+
43+
BUILD_NUMBER_OFFSET="$(cat build_number_offset)"
44+
45+
export APP_VERSION=$(cat versions.json | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["app"]);')
46+
export COMMIT_COUNT=$(git rev-list --count HEAD)
47+
export COMMIT_COUNT="$(($COMMIT_COUNT+$BUILD_NUMBER_OFFSET))"
48+
export BUILD_NUMBER="$COMMIT_COUNT"
49+
echo "BUILD_NUMBER=$(echo $BUILD_NUMBER)" >> $GITHUB_ENV
50+
echo "APP_VERSION=$(echo $APP_VERSION)" >> $GITHUB_ENV
51+
52+
python3 build-system/Make/ImportCertificates.py --path build-system/fake-codesigning/certs
53+
python3 -u build-system/Make/Make.py \
54+
--bazelUserRoot="$BAZEL_USER_ROOT" \
55+
build \
56+
--configurationPath="build-system/appstore-configuration.json" \
57+
--codesigningInformationPath=build-system/fake-codesigning \
58+
--configuration=release_arm64 \
59+
--buildNumber="$BUILD_NUMBER"
60+
61+
# collect ipa
62+
OUTPUT_PATH="build/artifacts"
63+
rm -rf "$OUTPUT_PATH"
64+
mkdir -p "$OUTPUT_PATH"
65+
for f in bazel-out/applebin_ios-ios_arm*-opt-ST-*/bin/Telegram/Telegram.ipa; do
66+
cp "$f" $OUTPUT_PATH/
67+
done
68+
69+
# collect dsym
70+
mkdir -p build/DSYMs
71+
for f in bazel-out/applebin_ios-ios_arm*-opt-ST-*/bin/Telegram/*.dSYM; do
72+
cp -R "$f" build/DSYMs/
73+
done
74+
zip -r "./$OUTPUT_PATH/Telegram.DSYMs.zip" build/DSYMs 1>/dev/null
75+
76+
- name: Create Release
77+
id: create_release
78+
uses: actions/create-release@v1
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
with:
82+
tag_name: build-${{ env.BUILD_NUMBER }}
83+
release_name: Telegram ${{ env.APP_VERSION }} (${{ env.BUILD_NUMBER }})
84+
body: |
85+
An unsigned build of Telegram for iOS ${{ env.APP_VERSION }} (${{ env.BUILD_NUMBER }})
86+
draft: false
87+
prerelease: false
88+
89+
- name: Upload Release IPA
90+
id: upload-release-ipa
91+
uses: actions/upload-release-asset@v1
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
with:
95+
upload_url: ${{ steps.create_release.outputs.upload_url }}
96+
asset_path: /Users/Shared/telegram-ios/build/artifacts/Telegram.ipa
97+
asset_name: Telegram.ipa
98+
asset_content_type: application/zip
99+
100+
- name: Upload Release DSYM
101+
id: upload-release-dsym
102+
uses: actions/upload-release-asset@v1
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
with:
106+
upload_url: ${{ steps.create_release.outputs.upload_url }}
107+
asset_path: /Users/Shared/telegram-ios/build/artifacts/Telegram.DSYMs.zip
108+
asset_name: Telegram.DSYMs.zip
109+
asset_content_type: application/zip

0 commit comments

Comments
 (0)