summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/example/uwp/build.ps1
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-06-04 19:24:05 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-06-04 19:24:05 +0300
commitefc336e60cf1331bf5f3213d296981b87b8b2a6c (patch)
treeea59ea1a324f45f6e8a06cc0887b376bfba90ca9 /protocols/Telegram/tdlib/td/example/uwp/build.ps1
parent6e83622d2af1cec3c759f4cff6efe4df2fe3328c (diff)
fixes #3537 (Telegram: 32-разрядная версия падает в 64-разрядной Windows) + update to the fresh TDLIB
Diffstat (limited to 'protocols/Telegram/tdlib/td/example/uwp/build.ps1')
-rw-r--r--protocols/Telegram/tdlib/td/example/uwp/build.ps137
1 files changed, 33 insertions, 4 deletions
diff --git a/protocols/Telegram/tdlib/td/example/uwp/build.ps1 b/protocols/Telegram/tdlib/td/example/uwp/build.ps1
index 587945a4b2..463592fa3d 100644
--- a/protocols/Telegram/tdlib/td/example/uwp/build.ps1
+++ b/protocols/Telegram/tdlib/td/example/uwp/build.ps1
@@ -3,7 +3,8 @@ param (
[string]$arch = "",
[string]$mode = "all",
[string]$compress = "7z",
- [switch]$release_only = $false
+ [switch]$release_only = $false,
+ [switch]$nupkg = $false
)
$ErrorActionPreference = "Stop"
@@ -15,7 +16,7 @@ if ($arch) {
$arch_list = @(, $arch)
}
$config_list = @( "Debug", "Release" )
-if ($release_only) {
+if ($release_only -or $nupkg) {
$config_list = @(, "RelWithDebInfo")
}
$targets = @{ Debug = "Debug"; Release = "Retail"; RelWithDebInfo = "CommonConfiguration"}
@@ -77,13 +78,14 @@ function build {
cd $arch
ForEach ($config in $config_list) {
cmake --build . --config $config --target tddotnet
+ CheckLastExitCode
}
cd ..
}
cd ..
}
-function export {
+function export-vsix {
cd build-uwp
Remove-Item vsix -Force -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path vsix
@@ -119,6 +121,29 @@ function export {
cd ..
}
+function export-nupkg {
+ cd build-uwp
+ Remove-Item nupkg -Force -Recurse -ErrorAction SilentlyContinue
+ New-Item -ItemType Directory -Force -Path nupkg/build/native
+ cp ../LICENSE_1_0.txt nupkg
+ cp ../Telegram.Td.UWP.nuspec nupkg
+ cp ../Telegram.Td.UWP.targets nupkg/build/native
+
+ ForEach ($arch in $arch_list) {
+ New-Item -ItemType Directory -Force -Path nupkg/runtimes/win10-${arch}/native
+ New-Item -ItemType Directory -Force -Path nupkg/lib/uap10.0
+
+ ForEach ($config in $config_list) {
+ cp ${arch}/${config}/* -include "SSLEAY*","LIBEAY*","libcrypto*","libssl*","zlib*","Telegram.Td.pdb","Telegram.Td.pri","Telegram.Td.dll" nupkg/runtimes/win10-${arch}/native
+ cp ${arch}/${config}/* -include "Telegram.Td.winmd","Telegram.Td.xml" nupkg/lib/uap10.0
+ }
+ }
+
+ cd nupkg
+ nuget pack Telegram.Td.UWP.nuspec
+ cd ..
+}
+
function run {
Push-Location
Try {
@@ -135,7 +160,11 @@ function run {
build
}
if (($mode -eq "export") -or ($mode -eq "all")) {
- export
+ if ($nupkg) {
+ export-nupkg
+ } else {
+ export-vsix
+ }
}
} Finally {
Pop-Location