mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Add how to documentation for build configuration based setup
This commit is contained in:
parent
90759c7788
commit
3ce5806f95
4 changed files with 42 additions and 0 deletions
41
docs/HowTo-Configuration-Based-Setup-template.md
Normal file
41
docs/HowTo-Configuration-Based-Setup-template.md
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
## Introduction
|
||||
|
||||
It can be useful to use a different setup depending on your Xcode build configuration, e.g. disable Beta Update checks in Debug builds.
|
||||
|
||||
To do that, we recommend to define a preprocessor macro for all configurations and use compiler directives to setup the SDK depending on the currently used build configuration.
|
||||
|
||||
**Note:** Beta Update checks is automatically disable when the SDK detects it is running in an App Store build. So you don't have to do anything in that scenario!
|
||||
|
||||
## HowTo
|
||||
|
||||
1. Select your project in the Project Navigator.
|
||||
2. Select your target.
|
||||
3. Select the tab "Build Settings".
|
||||
4. Enter "preprocessor macros" into the search field.
|
||||
|
||||

|
||||
|
||||
5. Select the top-most line and double-click the value field.
|
||||
6. Click the + button.
|
||||
7. Enter the following string into the input field and finish with "Done".<pre><code>CONFIGURATION_$(CONFIGURATION)</code></pre>
|
||||
|
||||

|
||||
|
||||
Now you can use `#if defined (CONFIGURATION_ABCDEF)` directives in your code, where `ABCDEF` is the actual name of your build configuration.
|
||||
|
||||
**Note:** Make sure to use build configuration names without spaces!
|
||||
|
||||
## Example
|
||||
|
||||
#if defined (CONFIGURATION_Debug)
|
||||
[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"<>"
|
||||
delegate:nil];
|
||||
[[BITHockeyManager sharedHockeyManager] setDisableUpdateManager:YES];
|
||||
#else
|
||||
[[BITHockeyManager sharedHockeyManager] configureWithBetaIdentifier:@"<>"
|
||||
liveIdentifier:@"<>"
|
||||
delegate:nil];
|
||||
#endif
|
||||
|
||||
[[BITHockeyManager sharedHockeyManager] startManager];
|
||||
|
||||
BIN
docs/XcodeMacros1_normal.png
Normal file
BIN
docs/XcodeMacros1_normal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 152 KiB |
BIN
docs/XcodeMacros2_normal.png
Normal file
BIN
docs/XcodeMacros2_normal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 155 KiB |
|
|
@ -30,6 +30,7 @@ HowTos
|
|||
- [How to do app versioning](HowTo-App-Versioning)
|
||||
- [How to upload symbols for crash reporting](HowTo-Upload-Symbols)
|
||||
- [How to handle crashes on startup](HowTo-Handle-Crashes-On-Startup)
|
||||
- [How to do Xcode build confugration based SDK setup](HowTo-Configuration-Based-Setup)
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue