diff --git a/example/uwp/Telegram.Td.UWP.nuspec b/example/uwp/Telegram.Td.UWP.nuspec new file mode 100644 index 000000000..21800e205 --- /dev/null +++ b/example/uwp/Telegram.Td.UWP.nuspec @@ -0,0 +1,16 @@ + + + + Telegram.Td.UWP + 1.8.12 + TDLib for Universal Windows Platform + Telegram + Telegram + false + LICENSE_1_0.txt + https://core.telegram.org/tdlib + https://github.com/tdlib/td/blob/master/CHANGELOG.md + TDLib for Universal Windows Platform + © Telegram FZ-LLC. All rights reserved. + + \ No newline at end of file diff --git a/example/uwp/Telegram.Td.UWP.targets b/example/uwp/Telegram.Td.UWP.targets new file mode 100644 index 000000000..3625bc7cc --- /dev/null +++ b/example/uwp/Telegram.Td.UWP.targets @@ -0,0 +1,19 @@ + + + + + x86 + $(Platform) + + + + + Telegram.Td.dll + + + + + + + + \ No newline at end of file diff --git a/example/uwp/build.ps1 b/example/uwp/build.ps1 index 587945a4b..2f9ec06c3 100644 --- a/example/uwp/build.ps1 +++ b/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"} @@ -83,7 +84,7 @@ function build { 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 +120,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 +159,11 @@ function run { build } if (($mode -eq "export") -or ($mode -eq "all")) { - export + if ($nupkg) { + export-nupkg + } else { + export-vsix + } } } Finally { Pop-Location