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: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "external/libzip"]
path = external/libzip
url = https://github.com/nih-at/libzip.git
[submodule "external/vcpkg"]
path = external/vcpkg
url = https://github.com/Microsoft/vcpkg
13 changes: 7 additions & 6 deletions LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(MSBuildThisFileDirectory)..\LibZipSharp.props" />
<PropertyGroup>
<TargetFramework>net471</TargetFramework>
<TargetFrameworks>net471</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOsPlatform('Windows')) And $([MSBuild]::IsOsPlatform('Linux'))">$(TargetFrameworks);netcoreapp3.1</TargetFrameworks>

<IsPackable>false</IsPackable>
<LibZipSharpBundleAllNativeLibraries>true</LibZipSharpBundleAllNativeLibraries>
<ReferenceNuget Condition="'$(ReferenceNuget)' == ''">False</ReferenceNuget>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<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="Xamarin.LibZipSharp" Version="$(_LibZipSharpNugetVersion)" Condition="'$(ReferenceNuget)' == 'True'" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.10.0" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.11.1" />
</ItemGroup>

<ItemGroup>
Expand All @@ -32,8 +33,8 @@
<PropertyGroup>
<Host Condition="'$(OS)' != 'Windows_NT'">mono </Host>
</PropertyGroup>
<Exec Command="$(Host)$(NuGetPackageRoot)nunit.consolerunner/3.10.0/tools/nunit3-console.exe LibZipSharp.UnitTest.dll"
WorkingDirectory="$(OutputPath)"
<Exec Command="$(Host)$(NuGetPackageRoot)/nunit.consolerunner/3.11.1/tools/nunit3-console.exe LibZipSharp.UnitTest.dll"
WorkingDirectory="$(OutputPath)net471"
/>
</Target>
</Project>
2 changes: 1 addition & 1 deletion LibZipSharp.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_LibZipSharpNugetVersion>1.0.10</_LibZipSharpNugetVersion>
<_LibZipSharpNugetVersion>1.0.11</_LibZipSharpNugetVersion>
</PropertyGroup>
</Project>
107 changes: 94 additions & 13 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,51 @@ variables:
stages:
- stage: Build
jobs:
- job: buildWindows
pool:
vmImage: vs2017-win2016
steps:
- script: |
echo "Hello"
git submodule update --init --recursive
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 bzip2:x64-windows-static
mkdir .\build\Windows\64
cd .\build\Windows\64
cmake -DCMAKE_TOOLCHAIN_FILE=..\..\..\external\vcpkg\scripts\buildsystems\vcpkg.cmake ..\..\..\external\libzip -G "Visual Studio 15 2017 Win64" -DBUILD_SHARED_LIBS=on -DVCPKG_TARGET_TRIPLET=x64-windows-static
cmake --build . --config Release
displayName: "x64 Build"
- script: |
external\vcpkg\vcpkg.exe integrate install
external\vcpkg\vcpkg.exe install zlib:x86-windows-static bzip2:x86-windows-static
mkdir .\build\Windows\32
cd .\build\Windows\32
cmake -DCMAKE_TOOLCHAIN_FILE=..\..\..\external\vcpkg\scripts\buildsystems\vcpkg.cmake ..\..\..\external\libzip -G "Visual Studio 15 2017" -DBUILD_SHARED_LIBS=on -DVCPKG_TARGET_TRIPLET=x86-windows-static
cmake --build . --config Release
displayName: "x86 Build"
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: build\Windows\64\lib\Release\zip.dll
includeRootFolder: false
archiveType: 7z
replaceExistingArchive: true
archiveFile: $(Build.ArtifactStagingDirectory)\libzip-windows-x86.7z
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: build\Windows\64\lib\Release\zip.dll
includeRootFolder: false
archiveType: 7z
replaceExistingArchive: true
archiveFile: $(Build.ArtifactStagingDirectory)\libzip-windows-x64.7z
- task: PublishBuildArtifacts@1
displayName: upload artifacts
inputs:
artifactName: 'native'
pathtoPublish: $(Build.ArtifactStagingDirectory)
- job: buildlinux
pool:
vmImage: ubuntu-16.04
Expand All @@ -36,14 +81,14 @@ stages:
displayName: 'Build Linux x86'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: build/Linux/32/lib/libzip.so.5.0
rootFolderOrFile: build/Linux/32/lib/libzip.so.5.1
includeRootFolder: false
archiveType: 7z
replaceExistingArchive: true
archiveFile: $(Build.ArtifactStagingDirectory)/libzip-linux-x86.7z
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: build/Linux/64/lib/libzip.so.5.0
rootFolderOrFile: build/Linux/64/lib/libzip.so.5.1
includeRootFolder: false
archiveType: 7z
replaceExistingArchive: true
Expand All @@ -54,21 +99,23 @@ stages:
artifactName: 'native'
pathtoPublish: $(Build.ArtifactStagingDirectory)
- job: build
dependsOn: buildlinux
dependsOn:
- buildlinux
- buildWindows
pool:
vmImage: xcode9-macos10.13
vmImage: macOS-10.14
steps:
- bash: |
brew tap xamarin/xamarin-android-windeps
brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/a6542037a48a55061a4c319e6bb174b3715f7cbe/Formula/mingw-w64.rb
brew install mingw-w64 p7zip
brew install ninja xamarin/xamarin-android-windeps/mingw-zlib
brew install p7zip ninja
git submodule update --init --recursive
- bash: |
HOSTOS=Darwin ./build_native
./build_windows
displayName: 'Build Darwin'
- bash: |
mkdir -p build/Linux/64
mkdir -p build/Linux/32
mkdir -p build/Windows/64
mkdir -p build/Windows/32
find build/* | grep libzip
- task: DownloadBuildArtifacts@0
displayName: download artifacts
Expand All @@ -85,10 +132,23 @@ stages:
inputs:
archiveFilePatterns: $(Build.ArtifactStagingDirectory)/native/libzip-linux-x86.7z
destinationFolder: build/Linux/32
- task: ExtractFiles@1
displayName: Extract 64 bit Windows native
inputs:
archiveFilePatterns: $(Build.ArtifactStagingDirectory)/native/libzip-windows-x64.7z
destinationFolder: build/Windows/64
- task: ExtractFiles@1
displayName: Extract 32 bit Windows native
inputs:
archiveFilePatterns: $(Build.ArtifactStagingDirectory)/native/libzip-windows-x86.7z
destinationFolder: build/Windows/32
- bash: |
mv build/Linux/32/libzip.so.5.0 build/Linux/32/libzip.so
mv build/Linux/64/libzip.so.5.0 build/Linux/64/libzip.so
mv build/Linux/32/libzip.so.5.1 build/Linux/32/libzip.so
mv build/Linux/64/libzip.so.5.1 build/Linux/64/libzip.so
mv build/Windows/32/zip.dll build/Windows/32/libzip.dll
mv build/Windows/64/zip.dll build/Windows/64/libzip.dll
rm $(Build.ArtifactStagingDirectory)/native/libzip-linux-*.7z
rm $(Build.ArtifactStagingDirectory)/native/libzip-windows-*.7z
displayName: 'Find libzip'
- task: MSBuild@1
displayName: 'Build solution libZipSharp.csproj'
Expand Down Expand Up @@ -136,22 +196,37 @@ 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: xcode9-macos10.13
vmImage: macOS-10.14
steps:
- task: DownloadBuildArtifacts@0
displayName: download artifacts
inputs:
artifactName: NuGet
downloadPath: $(Build.SourcesDirectory)
- task: UseDotNet@2
inputs:
version: '3.1.x'
- task: MSBuild@1
displayName: 'Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
inputs:
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: testwindows
displayName: 'Test Windows'
pool:
Expand All @@ -163,11 +238,17 @@ stages:
artifactName: NuGet
downloadPath: $(Build.SourcesDirectory)
- task: MSBuild@1
displayName: 'Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
displayName: 'Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj and Run tests'
inputs:
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'
- stage: Publish
dependsOn: Test
condition: eq(variables['System.TeamProject'], 'devdiv') # only sign the packages when running on Windows, and using the private server which has the certificates
Expand Down
2 changes: 1 addition & 1 deletion external/libzip
Submodule libzip updated 424 files
1 change: 1 addition & 0 deletions external/vcpkg
Submodule vcpkg added at 7365cd
6 changes: 3 additions & 3 deletions libZipSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
<Link>libZipSharp.dll.config</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="build\Darwin\64\lib\libzip.5.0.dylib" PackagePath="runtimes\osx\native\libzip.dylib" Pack="true" />
<None Include="build\Windows\64\lib\libzip.dll" PackagePath="runtimes\win-x64\native\libzip.dll" Pack="true" />
<None Include="build\Windows\32\lib\libzip.dll" PackagePath="runtimes\win-x86\native\libzip.dll" Pack="true" />
<None Include="build\Darwin\64\lib\libzip.5.1.dylib" PackagePath="runtimes\osx\native\libzip.dylib" Pack="true" />
<None Include="build\Windows\64\libzip.dll" PackagePath="runtimes\win-x64\native\libzip.dll" Pack="true" />
<None Include="build\Windows\32\libzip.dll" PackagePath="runtimes\win-x86\native\libzip.dll" Pack="true" />
<None Include="build\Linux\64\libzip.so" PackagePath="runtimes\linux-x64\native\libzip.so" Pack="true" />
<None Include="build\Linux\32\libzip.so" PackagePath="runtimes\linux-x86\native\libzip.so" Pack="true" />
<None Include="LICENSE" PackagePath="Licences" Pack="true" />
Expand Down
11 changes: 5 additions & 6 deletions libzip-static.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 92c4becc..e58b7db3 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -211,7 +211,7 @@ ENDIF()

ADD_LIBRARY(zip ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPTIONAL_FILES} ${LIBZIP_OPSYS_FILES})
SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 5.0 SOVERSION 5)
-TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY})
+TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY} OpenSSL::Crypto -ldl -pthread)
@@ -228,7 +228,7 @@ ENDIF()


-TARGET_LINK_LIBRARIES(zip PRIVATE ${ZLIB_LIBRARIES} ${OPTIONAL_LIBRARY})
+TARGET_LINK_LIBRARIES(zip PRIVATE ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY} OpenSSL::Crypto -ldl -pthread)
INSTALL(TARGETS zip
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}