Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
<ItemGroup>
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Xamarin.LibZipSharp" Version="$(_LibZipSharpNugetVersion)" Condition="'$(ReferenceNuget)' == 'True'" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.11.1" />
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
38 changes: 16 additions & 22 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -195,6 +175,8 @@ stages:
pathtoPublish: $(Build.ArtifactStagingDirectory)
- stage: Test
dependsOn: Build
variables:
DotNetCoreVersion: 3.1.201
jobs:
- job: testlinux
displayName: 'Test Linux'
Expand All @@ -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:
Expand All @@ -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:
Expand Down
27 changes: 27 additions & 0 deletions build_windows.bat
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions yaml-templates/use-dot-net.yaml
Original file line number Diff line number Diff line change
@@ -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'))