From fe5e2ed6eb79c8dc6ec26702333c2711166ad6c7 Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Wed, 7 Mar 2018 11:46:01 +0300 Subject: [PATCH] uwp example: readme GitOrigin-RevId: 58f7ecebab6e03810d99c5bc71c9024045a008e3 --- example/uwp/README.md | 27 +++++++++++++++++++++++++++ example/uwp/build.ps1 | 14 ++++++++------ 2 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 example/uwp/README.md diff --git a/example/uwp/README.md b/example/uwp/README.md new file mode 100644 index 000000000..b50a0a573 --- /dev/null +++ b/example/uwp/README.md @@ -0,0 +1,27 @@ +# TDLib Universal Windows Platform example + +Here are script for building TDLib SDK for universal windows platfrom and an example of its usage. + +## Building SDK + +1. Install [vcpkg](https://github.com/Microsoft/vcpkg). +2. With `vcpkg` install `zlib` and `openssl` for all UWP architectures. +``` +.\vcpkg.exe install openssl:arm-uwp openssl:arm64-uwp openssl:x64-uwp openssl:x86-uwp zlib:arm-uwp zlib:arm64-uwp zlib:x64-uwp zlib:x86-uwp +``` +3. Install 7z. You may also use zip or winrar. +4. Run build.ps1 with `powershell`. +Pass path to vcpkg as `-vcpkg-root` argument. +``` +.\build.ps1 -vcpkg-root "~\vcpkg\" +``` +If you wish to use `zip` or `WinRAR` instead of `7z` pass `-compress zip` or `-compress winrar`. +The build process will take a lot of time, as TDLib will be built for multiple +platforms in Debug and Release configurations. You may interrupt and resume the script at any moment. +If you will need to restart the build from scratch, call `.\build.ps -mode "clean"` first. +5. `tdlib.vsix` will be at `build-uwp\vsix\tdlib.vsix`. Open it and install the SDK. + +## Example of usage +`app` directory contains an example of UWP app for windows. Just open it with Visual Studio 2015 or 2017 and run. + + diff --git a/example/uwp/build.ps1 b/example/uwp/build.ps1 index 375dcc1a9..dbbad948c 100644 --- a/example/uwp/build.ps1 +++ b/example/uwp/build.ps1 @@ -2,6 +2,7 @@ param ( [string]$vcpkg_root = $(throw "-vcpkg_root= is required"), [string]$arch = "", [string]$mode = "all" + [string]$compress = "7z" ) $ErrorActionPreference = "Stop" @@ -105,18 +106,19 @@ function export { cd vsix - 7z.exe a -tzip -r tdlib.vsix * - #zip -r tdlib.vsix * - #WinRAR.exe a -afzip -r -ep1 tdlib.vsix * + if ($compress -eq "zip") { + zip -r tdlib.vsix * + } else if ($compress -eq "winrar") { + WinRAR.exe a -afzip -r -ep1 tdlib.vsix * + } else { + 7z.exe a -tzip -r tdlib.vsix * + } cd .. } function run { Push-Location Try { - if (($mode -eq "clean") -or ($mode -eq "all")) { - clean - } if (($mode -eq "prepare") -or ($mode -eq "all")) { prepare }