diff --git a/LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj b/LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
index da6b0309..92847be8 100644
--- a/LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
+++ b/LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
@@ -13,9 +13,10 @@
-
+
+
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 67e084f3..69fdf1cd 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -17,9 +17,6 @@ stages:
- job: buildWindows
pool:
vmImage: windows-latest
- variables:
- LIBZIP_FEATURES: -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF -DENABLE_BZIP2=OFF -DENABLE_LZMA=OFF
- COMMON_CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 16 2019" -DBUILD_SHARED_LIBS=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_POLICY_DEFAULT_CMP0074=NEW -DCMAKE_POLICY_DEFAULT_CMP0091=NEW
steps:
- script: |
echo "Hello"
@@ -30,25 +27,8 @@ stages:
git apply -v ../../libzip-changes.patch
displayName: "Apply Patches"
- script: |
- cd external/vcpkg
- bootstrap-vcpkg.bat
- displayName: "Build vcpkg"
- - script: |
- external\vcpkg\vcpkg.exe integrate install
- external\vcpkg\vcpkg.exe install zlib:x64-windows-static
- mkdir .\build\Windows\64
- cd .\build\Windows\64
- cmake $(LIBZIP_FEATURES) $(COMMON_CMAKE_PARAMS) -DZLIB_ROOT=..\..\..\external\vcpkg\installed\x64-windows-static -A x64 ..\..\..\external\libzip
- cmake --build . --config Release -v
- displayName: "x64 Build"
- - script: |
- external\vcpkg\vcpkg.exe integrate install
- external\vcpkg\vcpkg.exe install zlib:x86-windows-static
- mkdir .\build\Windows\32
- cd .\build\Windows\32
- cmake $(LIBZIP_FEATURES) $(COMMON_CMAKE_PARAMS) -DZLIB_ROOT=..\..\..\external\vcpkg\installed\x86-windows-static -A Win32 ..\..\..\external\libzip
- cmake --build . --config Release -v
- displayName: "x86 Build"
+ build_windows.bat
+ displayName: "Build"
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: build\Windows\32\lib\Release\zip.dll
@@ -195,6 +175,8 @@ stages:
pathtoPublish: $(Build.ArtifactStagingDirectory)
- stage: Test
dependsOn: Build
+ variables:
+ DotNetCoreVersion: 3.1.201
jobs:
- job: testlinux
displayName: 'Test Linux'
@@ -212,11 +194,20 @@ stages:
solution: LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
configuration: Release
msbuildArguments: /restore /t:RunNunitTests /p:ReferenceNuget=True /v:diag
+ - task: DotNetCoreCLI@2
+ displayName: "Run Tests under .net Core"
+ inputs:
+ command: test
+ projects: 'LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
+ arguments: '--configuration Release --framework netcoreapp3.1 --no-build'
- job: testmacos
displayName: 'Test MacOS'
pool:
vmImage: macOS-10.14
steps:
+ - template: yaml-templates/use-dot-net.yaml
+ parameters:
+ version: $(DotNetCoreVersion)
- task: DownloadBuildArtifacts@0
displayName: download artifacts
inputs:
@@ -233,6 +224,9 @@ stages:
pool:
vmImage: windows-2019
steps:
+ - template: yaml-templates/use-dot-net.yaml
+ parameters:
+ version: $(DotNetCoreVersion)
- task: DownloadBuildArtifacts@0
displayName: download artifacts
inputs:
diff --git a/build_windows.bat b/build_windows.bat
new file mode 100644
index 00000000..db3851c5
--- /dev/null
+++ b/build_windows.bat
@@ -0,0 +1,27 @@
+@echo off
+
+set LIBZIP_FEATURES=-DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF -DBUILD_TOOLS=OFF -DBUILD_REGRESS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOC=OFF -DENABLE_BZIP2=OFF -DENABLE_LZMA=OFF
+set COMMON_CMAKE_PARAMS=-DCMAKE_BUILD_TYPE=Release -G "Visual Studio 16 2019" -DBUILD_SHARED_LIBS=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_POLICY_DEFAULT_CMP0074=NEW -DCMAKE_POLICY_DEFAULT_CMP0091=NEW
+
+echo %LIBZIP_FEATURES%
+echo %COMMON_CMAKE_PARAMS%
+
+pushd .
+cd external\vcpkg
+call bootstrap-vcpkg.bat
+popd
+external\vcpkg\vcpkg.exe integrate install
+external\vcpkg\vcpkg.exe install zlib:x64-windows-static zlib:x86-windows-static
+pushd .
+mkdir .\build\Windows\64
+cd .\build\Windows\64
+cmake %LIBZIP_FEATURES% %COMMON_CMAKE_PARAMS% -DZLIB_ROOT=..\..\..\external\vcpkg\installed\x64-windows-static -A x64 ..\..\..\external\libzip
+cmake --build . --config Release -v
+popd
+pushd .
+
+mkdir .\build\Windows\32
+cd .\build\Windows\32
+cmake %LIBZIP_FEATURES% %COMMON_CMAKE_PARAMS% -DZLIB_ROOT=..\..\..\external\vcpkg\installed\x86-windows-static -A Win32 ..\..\..\external\libzip
+cmake --build . --config Release -v
+popd
diff --git a/yaml-templates/use-dot-net.yaml b/yaml-templates/use-dot-net.yaml
new file mode 100644
index 00000000..5fd05e85
--- /dev/null
+++ b/yaml-templates/use-dot-net.yaml
@@ -0,0 +1,33 @@
+# This template enables installation of stable and master/nighly builds of .NET.
+# We prefer this over the UseDotNet task so that we can always clean up old/unstable versions on disk.
+
+parameters:
+ version: $(DotNetCoreVersion)
+ remove_dotnet: false
+
+steps:
+
+ - powershell: |
+ $ErrorActionPreference = 'Stop'
+ $ProgressPreference = 'SilentlyContinue'
+ $DotNetRoot = "$env:ProgramFiles\dotnet\"
+ if ("${{ parameters.remove_dotnet }}" -eq $true) {
+ Remove-Item -Recurse $DotNetRoot -Verbose
+ }
+ Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
+ & .\dotnet-install.ps1 -Version ${{ parameters.version }} -InstallDir $DotNetRoot -Verbose
+ & dotnet --list-sdks
+ displayName: install .NET Core ${{ parameters.version }}
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+ - bash: >
+ DOTNET_ROOT=~/.dotnet/ &&
+ (if [[ "${{ parameters.remove_dotnet }}" == "true" ]] ; then rm -rfv $DOTNET_ROOT; fi) &&
+ curl -L https://dot.net/v1/dotnet-install.sh > dotnet-install.sh &&
+ chmod +x dotnet-install.sh &&
+ ./dotnet-install.sh --version ${{ parameters.version }} --install-dir $DOTNET_ROOT --verbose &&
+ PATH="$DOTNET_ROOT:$PATH" &&
+ dotnet --list-sdks &&
+ echo "##vso[task.setvariable variable=DOTNET_ROOT]$DOTNET_ROOT" &&
+ echo "##vso[task.setvariable variable=PATH]$PATH"
+ displayName: install .NET Core ${{ parameters.version }}
+ condition: and(succeeded(), eq(variables['agent.os'], 'Darwin'))
\ No newline at end of file