From a6297b33e27cde05fbb4e633687fcbe18396bb08 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Fri, 5 Feb 2021 15:58:48 -0800 Subject: [PATCH] Add NuGet package and build scripts --- dist.ps1 | 144 +++++++++++++----- dist.sh | 6 +- pkg/nuget/README.md | 17 +++ .../ZeroTier.Sockets.x64.nuspec | 33 ++++ .../ZeroTier.Sockets.x86.nuspec | 33 ++++ pkg/nuget/ZeroTier.Sockets/icon.png | Bin 0 -> 5048 bytes pkg/nuget/ZeroTier.Sockets/readme.txt | 45 ++++++ src/bindings/csharp/README.md | 4 + 8 files changed, 238 insertions(+), 44 deletions(-) create mode 100644 pkg/nuget/README.md create mode 100644 pkg/nuget/ZeroTier.Sockets/ZeroTier.Sockets.x64.nuspec create mode 100644 pkg/nuget/ZeroTier.Sockets/ZeroTier.Sockets.x86.nuspec create mode 100644 pkg/nuget/ZeroTier.Sockets/icon.png create mode 100644 pkg/nuget/ZeroTier.Sockets/readme.txt diff --git a/dist.ps1 b/dist.ps1 index 0982366..de2d251 100644 --- a/dist.ps1 +++ b/dist.ps1 @@ -1,49 +1,24 @@ -function CreateNugetPackage -{ - md builds\pkg\nuget -Force - - # runtimes - md pkg\nuget\ZeroTier.Sockets\runtimes\win10-x86\native -Force - md pkg\nuget\ZeroTier.Sockets\runtimes\win10-x64\native -Force - md pkg\nuget\ZeroTier.Sockets\runtimes\win10-x64\lib\uap10.0 -Force - md pkg\nuget\ZeroTier.Sockets\runtimes\win10-arm\native -Force - - # frameworks - md pkg\nuget\ZeroTier.Sockets\lib\net48 -Force - md pkg\nuget\ZeroTier.Sockets\lib\net5.0 -Force - - # Build native libzt with exported P/INVOKE symbols - Build-Library -BuildType "Release" -Arch "x64" -LanguageBinding "csharp" - Build-Library -BuildType "Release" -Arch "x64" -LanguageBinding "" - - Build-Library -BuildType "Release" -Arch "Win32" -LanguageBinding "csharp" - #Build-Library -BuildType "Release" -Arch "ARM" -LanguageBinding "csharp" - - # Copy assemblies into NuGet package tree - Copy-Item .\lib\release\win-x64-pinvoke\*.dll pkg\nuget\ZeroTier.Sockets\runtimes\win10-x64\lib\uap10.0\libzt.dll - Copy-Item .\lib\release\win-x64\*.dll pkg\nuget\ZeroTier.Sockets\runtimes\win10-x64\native\libzt.dll - - Copy-Item .\lib\release\win-x86-pinvoke\*.dll pkg\nuget\ZeroTier.Sockets\runtimes\win10-x86\native\libzt.dll - #Copy-Item .\lib\release\win-arm-pinvoke\*.dll pkg\nuget\ZeroTier.Sockets\runtimes\win10-arm\native\libzt.dll - - # Build wrapper library for C# ZeroTier.Sockets abstraction - csc -target:library -out:pkg\nuget\ZeroTier.Sockets\lib\net5.0\ZeroTier.Sockets.dll .\src\bindings\csharp\*.cs - - # Package everything - Push-Location -Path pkg\nuget\ZeroTier.Sockets - - del ZeroTier.Sockets.*.nupkg - nuget pack ZeroTier.Sockets.nuspec -OutputDirectory ..\..\..\builds\pkg\nuget - - Pop-Location -} - function Clean { Remove-Item builds -Recurse -Force -Confirm:$false -ErrorAction:'silentlycontinue' Remove-Item tmp -Recurse -Force -Confirm:$false -ErrorAction:'silentlycontinue' Remove-Item lib -Recurse -Force -Confirm:$false -ErrorAction:'silentlycontinue' Remove-Item bin -Recurse -Force -Confirm:$false -ErrorAction:'silentlycontinue' + # pkg + Clean-PackageDirectory + Get-ChildItem pkg -recurse -include *.dll | remove-item + Get-ChildItem pkg -recurse -include *.lib | remove-item + Get-ChildItem pkg -recurse -include *.pdb | remove-item + Get-ChildItem pkg -recurse -include *.nupkg | remove-item + # src + Get-ChildItem src -recurse -include *.dll | remove-item + Get-ChildItem src -recurse -include *.lib | remove-item + Get-ChildItem src -recurse -include *.pdb | remove-item + Get-ChildItem src -recurse -include *.dylib | remove-item + Get-ChildItem src -recurse -include *.so | remove-item + Get-ChildItem src -recurse -include *.exe | remove-item + Get-ChildItem src -recurse -include *.out | remove-item + Get-ChildItem src -recurse -include *.a | remove-item } function Build-Library([string]$BuildType, [string]$Arch, [string]$LanguageBinding) @@ -96,6 +71,7 @@ function Build-Library([string]$BuildType, [string]$Arch, [string]$LanguageBindi Pop-Location Copy-Item $env:BuildDir\$BuildType\zt.lib $env:OutputDir\$archAlias$LanguageBindingPostfix\libzt$bitCount.lib Copy-Item $env:BuildDir\$BuildType\zt-shared.dll $env:OutputDir\$archAlias$LanguageBindingPostfix\libzt$bitCount.dll + Copy-Item $env:BuildDir\$BuildType\zt-shared.pdb $env:OutputDir\$archAlias$LanguageBindingPostfix\libzt$bitCount.pdb } function Build-All @@ -110,4 +86,90 @@ function Build-All Build-Library -BuildType "Release" -Arch "x64" -LanguageBinding "pinvoke" Build-Library -BuildType "Debug" -Arch "x64" -LanguageBinding "" Build-Library -BuildType "Debug" -Arch "x64" -LanguageBinding "pinvoke" -} \ No newline at end of file +} + +function BuildNuGetPackages([string]$Version) +{ + BuildNuGetPackage-Sockets -BuildType "Release" -Arch "x64" -Version $Version + BuildNuGetPackage-Sockets -BuildType "Debug" -Arch "x64" -Version $Version + BuildNuGetPackage-Sockets -BuildType "Release" -Arch "Win32" -Version $Version + BuildNuGetPackage-Sockets -BuildType "Debug" -Arch "Win32" -Version $Version +} + +function BuildNuGetPackage-Sockets([string]$BuildType, [string]$Arch, [string]$Version) +{ + $archAlias = $Arch + if ($Arch -eq "Win32") { + $archAlias="x86" + } + + md pkg\nuget\ZeroTier.Sockets\bin\ -Force + md builds\pkg\nuget\$($BuildType.ToLower())\$archAlias -Force + del builds\pkg\nuget\$($BuildType.ToLower())\$archAlias\*.nupkg -ErrorAction:'silentlycontinue' + + # licenses + md pkg\nuget\ZeroTier.Sockets\licenses -Force + Copy-Item LICENSE.txt pkg\nuget\ZeroTier.Sockets\licenses + + # contentFiles (sources) + md pkg\nuget\ZeroTier.Sockets\contentFiles -Force + Copy-Item src\bindings\csharp\*.cs pkg\nuget\ZeroTier.Sockets\contentFiles + + # Where we plan to output *.nupkg(s) + md builds\pkg\nuget\$($BuildType.ToLower()) -Force + + # runtimes + md pkg\nuget\ZeroTier.Sockets\runtimes\win10-$archAlias\native -Force + md pkg\nuget\ZeroTier.Sockets\runtimes\win10-$archAlias\lib\uap10.0 -Force + #md pkg\nuget\ZeroTier.Sockets\runtimes\win10-arm\native -Force + + # Build wrapper library for C# ZeroTier.Sockets abstraction + csc -target:library -debug:pdbonly -pdb:pkg\nuget\ZeroTier.Sockets\bin\ZeroTier.Sockets.pdb -out:pkg\nuget\ZeroTier.Sockets\bin\ZeroTier.Sockets.dll .\src\bindings\csharp\*.cs + + # Build unmanaged native libzt.dll with exported P/INVOKE symbols + Build-Library -BuildType $BuildType -Arch $Arch -LanguageBinding "csharp" + Copy-Item .\lib\$($BuildType.ToLower())\win-$archAlias-pinvoke\*.dll pkg\nuget\ZeroTier.Sockets\bin\libzt.dll + + # .NET Framework + md pkg\nuget\ZeroTier.Sockets\lib\net40 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net403 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net45 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net451 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net452 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net46 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net461 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net462 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net47 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net471 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net472 -Force + md pkg\nuget\ZeroTier.Sockets\lib\net48 -Force + + # .NET "Core" 5.0 (moniker missing from microsoft documentation?) + md pkg\nuget\ZeroTier.Sockets\lib\net5.0 -Force + + # Copy assemblies into framework-specific directories. + $folders = Get-ChildItem pkg\nuget\ZeroTier.Sockets\lib\ + foreach ($folder in $folders.name){ + Copy-Item -Path "pkg\nuget\ZeroTier.Sockets\bin\*.*" -Destination "pkg\nuget\ZeroTier.Sockets\lib\$folder" -Recurse + } + + # Native DLL placement + Copy-Item .\lib\$($BuildType.ToLower())\win-$archAlias-pinvoke\*.dll pkg\nuget\ZeroTier.Sockets\runtimes\win10-$archAlias\lib\uap10.0\libzt.dll + Copy-Item .\lib\$($BuildType.ToLower())\win-$archAlias-pinvoke\*.dll pkg\nuget\ZeroTier.Sockets\lib\net40\libzt.dll + Copy-Item .\lib\$($BuildType.ToLower())\win-$archAlias-pinvoke\*.dll pkg\nuget\ZeroTier.Sockets\runtimes\win10-$archAlias\native\libzt.dll + Copy-Item .\lib\$($BuildType.ToLower())\win-$archAlias-pinvoke\*.pdb pkg\nuget\ZeroTier.Sockets\runtimes\win10-$archAlias\lib\uap10.0\libzt.pdb + + # Package + Push-Location -Path pkg\nuget\ZeroTier.Sockets + nuget pack ZeroTier.Sockets.$archAlias.nuspec -Version $Version -OutputDirectory ..\..\..\builds\pkg\nuget\$($BuildType.ToLower())\$archAlias + Pop-Location +} + +function Clean-PackageDirectory +{ + Remove-Item pkg\nuget\ZeroTier.Sockets\lib -Recurse -Force -Confirm:$false -ErrorAction:'silentlycontinue' + Remove-Item pkg\nuget\ZeroTier.Sockets\contentFiles -Recurse -Force -Confirm:$false -ErrorAction:'silentlycontinue' + Remove-Item pkg\nuget\ZeroTier.Sockets\licenses -Recurse -Force -Confirm:$false -ErrorAction:'silentlycontinue' + Remove-Item pkg\nuget\ZeroTier.Sockets\runtimes -Recurse -Force -Confirm:$false -ErrorAction:'silentlycontinue' + Remove-Item pkg\nuget\ZeroTier.Sockets\bin -Recurse -Force -Confirm:$false -ErrorAction:'silentlycontinue' +} diff --git a/dist.sh b/dist.sh index ee27f15..05131c2 100755 --- a/dist.sh +++ b/dist.sh @@ -388,11 +388,11 @@ clean_post_build() clean() { # Remove all temporary build files, products, etc - rm -rf tmp lib bin products + rm -rf builds tmp lib bin products rm -f *.o *.s *.exp *.lib *.core core # Generally search for and remove object files, libraries, etc - find . -path './*_products' -prune -type f \( -name '*.dylib' -o -name '*.so' -o -name \ - '*.a' -o -name '*.o' -o -name '*.o.d' -o -name \ + find . -path './*_products' -prune -type f \( -name '*.dylib' -o -name '*.dll' -o -name '*.so' -o -name \ + '*.a' -o -name '*.o' -o -name '*.exe' -o -name '*.o.d' -o -name \ '*.out' -o -name '*.log' -o -name '*.dSYM' -o -name '*.class' \) -delete # Remove any sources copied to project directories rm -rf ports/android/app/src/main/java/com/zerotier/libzt/*.java diff --git a/pkg/nuget/README.md b/pkg/nuget/README.md new file mode 100644 index 0000000..c7460d7 --- /dev/null +++ b/pkg/nuget/README.md @@ -0,0 +1,17 @@ +# NuGet package + +Install from [NuGet gallery package]() (recommended): + +```powershell +Install-Package ZeroTier.Sockets +``` + +Install from local package + +```powershell +Install-Package ZeroTier.Sockets -Source C:\PathToThePackageDir\ +``` + +Development notes + + - Microsoft's own documentation on multi-architecture nupkgs was outdated and Marco Siccardi seemed to have [the only correct instructions found anywhere on the internet](https://msicc.net/how-to-create-a-multi-architecture-nuget-package-from-a-uwp-class-library/) to accomplish this. \ No newline at end of file diff --git a/pkg/nuget/ZeroTier.Sockets/ZeroTier.Sockets.x64.nuspec b/pkg/nuget/ZeroTier.Sockets/ZeroTier.Sockets.x64.nuspec new file mode 100644 index 0000000..bdf61b8 --- /dev/null +++ b/pkg/nuget/ZeroTier.Sockets/ZeroTier.Sockets.x64.nuspec @@ -0,0 +1,33 @@ + + + + ZeroTier.Sockets + 0.0.0 + ZeroTier, Inc. + ZeroTier, Inc. + http://github.com/zerotier/libzt + LICENSE.txt + icon.png + false + Initial release + Encrypted P2P SD-WAN networking layer (Managed C# API) [x64] + Encrypted P2P SD-WAN networking layer (Managed C# API) [x64] + Copyright 2021 ZeroTier, Inc. + p2p networking utility library sdwan socket tcp udp ip encryption vpn sdk zerotier libzt libzerotier native + + + + + + + + + + + + + + + + + diff --git a/pkg/nuget/ZeroTier.Sockets/ZeroTier.Sockets.x86.nuspec b/pkg/nuget/ZeroTier.Sockets/ZeroTier.Sockets.x86.nuspec new file mode 100644 index 0000000..dd77924 --- /dev/null +++ b/pkg/nuget/ZeroTier.Sockets/ZeroTier.Sockets.x86.nuspec @@ -0,0 +1,33 @@ + + + + ZeroTier.Sockets.x86 + 0.0.0 + ZeroTier, Inc. + ZeroTier, Inc. + http://github.com/zerotier/libzt + LICENSE.txt + icon.png + false + Initial release + Encrypted P2P SD-WAN networking layer (Managed C# API) [x86] + Encrypted P2P SD-WAN networking layer (Managed C# API) [x86] + Copyright 2021 ZeroTier, Inc. + p2p networking utility library sdwan socket tcp udp ip encryption vpn sdk zerotier libzt libzerotier native + + + + + + + + + + + + + + + + + diff --git a/pkg/nuget/ZeroTier.Sockets/icon.png b/pkg/nuget/ZeroTier.Sockets/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..55f65bbf3621ecca7e10f0024cfa7fce62da7708 GIT binary patch literal 5048 zcmZ`-XFyX~(@y9`KspFW?>!6Ie z8z>#AD)0t&*X8ruy~*4&XU_A?nVEa${<($=`m|VMwUI2Lj~*_vJYC z>*Nd%Kq+u>oo@8&`ZG=#+T)*{e35^pg-cNUbVXcJOhWwMXt-p5#rJ<$XeY#fl29J5 z|FPHU%74;apue_41o(TO6~YB74)ccjza#C`?gO z{w$gErhh8&C;IFdLDW5P9+9}JDauLw#rb{VUy0WLMLf4~j)*HBSj``HdT7nzaBs!m z&#=7s?}*>X25=V-*C2H#6io47PWzwqbC`4N(?WwyVMw@l!0G9*@by3`g5<^j&HOt{ z4eo>Rhau0(gR9ON<-F~8ypg{L?(sOCZgcts&hY1LzvChQgrz9+cTDGvzZ0zgjd0$0 zj^F|XBLkd0VNldrxBY5@v$j)pauYvimKXp3XnFC|K04P|e>Uxz71y!_=kqk(I7K`8S#%qN2`RGdInyl9ct{BRC}bPWxJps_qjq$roK)(X2& zX<{&15(ePs~kZm))&Iq2QUg;&fz(h`=01ze2<0ho+4uYtEP&DXbmaXGn zJ)zzUlKJtRwRGreY6AIi$e5&-9lwV#+>7G&3bUoeou%H%fMeKR2r2O7qTv#G>L@w6 z*qeQuh_{wUTx8h>uG{aw{Dk{IP*r`tC?c5~^`urDtoc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G+}h9Y+38*prbWaN%V+1Nrv^UaJEa)AA!57 z_f>s!5-0FQvyHb}{leJiY_oI&L5;UISZs~OwntcFaz6AYcu)#IS0K7vjHdltTGJU&skRyV6ou5uN9d{hHy~UFSva&$sm*?LcAz zJZfHH(1(cR_zQ#)w`!C2dc&0Uvg=ff4lDxYc?F&LNZrzII*YzV@-YY~v6yFFRA&y) zl?=O9hPct;LHZTbT$j?7Sx$^}%rW~!cL(XZznT&j!4NQf$X6@-N{cRi_j8Vj;a-!| zXR!RUUk)VkfHa@5p9D~8doMZxZ!^RbymPR9N_AJlXv2O;?T)-We&LWxA%8OJ`?{D^IvHu~`*o5ms<}Zq#C1)^D84GTp3Y2nG=11x zpvI+rNT`!hU*sLXB)v?gj{2}cJKp}>?7Zxy@JU008%4z^Th;Q9+dav0txw(ArCWIC zAP~}V-DXv*xE@n{szKDu76ObH zA{xL3Jpo1I7%ShwzL1mt4w-9791#NWifiAbeD9U>k1v2FmyE2?WX`X5J#04tqL2BO zzS6D>rcrHfox~Pf0B;g&DR0YKn}tsC)=2 z9Gapy={U%h9(ny1$<&Wo$BrDPxPjoC(}`Q`rm6B%fS8A(k$c-r?X(XHTl;e-G|SWp z6sD%*QWKJf^iaSQ&kh#9THXSF(c1_&1ioEp2McnmQVuV81QRa2XxLjD#p)8_pIR?r zo$dBggX+}`OVs6M&2eSt2T)I`DIyyO>&&Ff+X(x6U-UMmvj$fEfI83KfPJu~gW&v@ zy3tvRh_xewI)>CrX-8`cceYhq1~8UD*hok;YYDFC9opS&_no)9Idas}G_rApP6QKFfREtxR|`)qN*l0fp)cEr fWpLd00q&gu*^R#IaH#~JeSXr>FjTKnb&UKUN!Ncv literal 0 HcmV?d00001 diff --git a/pkg/nuget/ZeroTier.Sockets/readme.txt b/pkg/nuget/ZeroTier.Sockets/readme.txt new file mode 100644 index 0000000..c04fe02 --- /dev/null +++ b/pkg/nuget/ZeroTier.Sockets/readme.txt @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------- + ZeroTier.Sockets (libzt) --- Encrypted P2P SD-WAN networking layer +------------------------------------------------------------------------------- + +With ZeroTier's SDK you can embed a ZeroTier node into your application and +communicate with other ZeroTier nodes (or non-ZeroTier devices bridged onto a +ZeroTier network) securely within your own software-defined virtual network. + +C# API: + + - Guide: https://github.com/zerotier/libzt/tree/master/examples/csharp + +This package presents a managed .NET-style Socket API. It is designed as +a drop-in replacement for System.Net.Sockets. This is the easiest and most +idiomatic way to use ZeroTier in a C# application. + +Self-hosting: + +ZeroTier operates a hosted service (https://my.zerotier.com) that lets you +manage your virtual networks. If however you would like to self-host we make +that possible too: + + - https://github.com/zerotier/ZeroTierOne/tree/master/controller + +Other API options: + +We offer two other API layers depending on your use case. The first is a lower- +level BSD-style socket API. This API is similar to BSD-style sockets +(zts_socket(), zts_listen(), zts_bind(), etc.) The second is a Highly- +performant virtual Ethernet layer. It can be used for any transport protocol +and is only recommended for those who have advanced or specialty applications. + +Bug? + +You should let us know so we can fix it. Please open a github issue here: + + - https://www.github.com/zerotier/libzt + +------------------------------------------------------------------------------- + LINKS +------------------------------------------------------------------------------- + + - Documentation and bug reports: https://www.github.com/zerotier/libzt + - Website: https://www.zerotier.com + - Community: https://discuss.zerotier.com diff --git a/src/bindings/csharp/README.md b/src/bindings/csharp/README.md index 3793e1c..82a854c 100644 --- a/src/bindings/csharp/README.md +++ b/src/bindings/csharp/README.md @@ -2,3 +2,7 @@ - Install (via [NuGet package](https://www.nuget.org/packages/ZeroTier.Sockets/)): `Install-Package ZeroTier.Sockets` - Example usage: [examples/csharp](./../../../examples/csharp/) + +# Development Notes + + - The SWIG interface file `zt.i` is only present for historical reference purposes. SWIG generates a ton of unnecessary boilerplate code which is hard to completely prevent by using hints. You can generate a new wrapper for yourself using `swig -c++ -csharp -dllimport "./libzt.so" zt.i` but I would not recommend doing so unless you know what you're in for. \ No newline at end of file