diff --git a/build.ps1 b/build.ps1 index 01dfb59..8ed04b9 100644 --- a/build.ps1 +++ b/build.ps1 @@ -131,10 +131,18 @@ function BuildNuGetPackage([string]$BuildType, [string]$Arch, [string]$Version) #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 + #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 + + # Copy sources into bindings library project + cp .\src\bindings\csharp\*.cs .\pkg\nuget\bindings\ZeroTier.Sockets\ + + # Build bindings library + pushd ./pkg/nuget/bindings/ + dotnet build --configuration Release + popd # Build unmanaged native libzt.dll with exported P/INVOKE symbols Build-Library -BuildType $BuildType -Arch $Arch -LangBinding "csharp" @@ -145,7 +153,6 @@ function BuildNuGetPackage([string]$BuildType, [string]$Arch, [string]$Version) # .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 @@ -156,6 +163,19 @@ function BuildNuGetPackage([string]$BuildType, [string]$Arch, [string]$Version) md pkg\nuget\ZeroTier.Sockets\lib\net471 -Force md pkg\nuget\ZeroTier.Sockets\lib\net472 -Force md pkg\nuget\ZeroTier.Sockets\lib\net48 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netstandard1.3 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netstandard1.4 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netstandard1.5 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netstandard1.6 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netstandard2.0 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netstandard2.1 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netcoreapp1.0 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netcoreapp1.1 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netcoreapp2.0 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netcoreapp2.1 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netcoreapp2.2 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netcoreapp3.0 -Force + md pkg\nuget\ZeroTier.Sockets\lib\netcoreapp3.1 -Force # .NET "Core" 5.0 (moniker missing from microsoft documentation?) md pkg\nuget\ZeroTier.Sockets\lib\net5.0 -Force @@ -167,6 +187,13 @@ function BuildNuGetPackage([string]$BuildType, [string]$Arch, [string]$Version) -Destination "pkg\nuget\ZeroTier.Sockets\lib\$folder" -Recurse } + # Copy bindings library "ZeroTier.Sockets.dll" + $folders = Get-ChildItem .\pkg\nuget\bindings\ZeroTier.Sockets\bin\Release + foreach ($folder in $folders.name){ + cp -Path ".\pkg\nuget\bindings\ZeroTier.Sockets\bin\Release\$folder\*.dll" ` + -Destination "pkg\nuget\ZeroTier.Sockets\lib\$folder" -Recurse + } + # Native DLL placement cp .\dist\win-$archAlias-pinvoke-$($BuildType.ToLower())\lib\*.dll ` diff --git a/include/version.h b/include/version.h new file mode 100644 index 0000000..5db4ccc --- /dev/null +++ b/include/version.h @@ -0,0 +1,7 @@ +#ifndef ZTS_VERSION_H +#define ZTS_VER_CORE_STR="1.4.6" +#define ZTS_VER_LIB_STR="1.3.4" +#define ZTS_VER_LIB_MAJOR=1.3.4 +#define ZTS_VER_LIB_MINOR=1.3.4 +#define ZTS_VER_LIB_PATCH=1.3.4 +#endif diff --git a/pkg/nuget/bindings/ZeroTier.Sockets/ZeroTier.Sockets.csproj b/pkg/nuget/bindings/ZeroTier.Sockets/ZeroTier.Sockets.csproj new file mode 100644 index 0000000..306644b --- /dev/null +++ b/pkg/nuget/bindings/ZeroTier.Sockets/ZeroTier.Sockets.csproj @@ -0,0 +1,7 @@ + + + + net5.0;net40;net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard2.0;netstandard2.1 + + + diff --git a/pkg/nuget/bindings/dotnet.sln b/pkg/nuget/bindings/dotnet.sln new file mode 100644 index 0000000..10096a3 --- /dev/null +++ b/pkg/nuget/bindings/dotnet.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZeroTier.Sockets", "ZeroTier.Sockets\ZeroTier.Sockets.csproj", "{D4F39F65-88E6-457D-807A-AB602AE80D7A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Debug|x64.ActiveCfg = Debug|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Debug|x64.Build.0 = Debug|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Debug|x86.ActiveCfg = Debug|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Debug|x86.Build.0 = Debug|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Release|Any CPU.Build.0 = Release|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Release|x64.ActiveCfg = Release|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Release|x64.Build.0 = Release|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Release|x86.ActiveCfg = Release|Any CPU + {D4F39F65-88E6-457D-807A-AB602AE80D7A}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal