@@ -14,6 +14,51 @@ variables:
14
14
stages :
15
15
- stage : Build
16
16
jobs :
17
+ - job : buildWindows
18
+ pool :
19
+ vmImage : vs2017-win2016
20
+ steps :
21
+ - script : |
22
+ echo "Hello"
23
+ git submodule update --init --recursive
24
+ cd external/vcpkg
25
+ bootstrap-vcpkg.bat
26
+ displayName: "Build vcpkg"
27
+ - script : |
28
+ external\vcpkg\vcpkg.exe integrate install
29
+ external\vcpkg\vcpkg.exe install zlib:x64-windows-static bzip2:x64-windows-static
30
+ mkdir .\build\Windows\64
31
+ cd .\build\Windows\64
32
+ 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
33
+ cmake --build . --config Release
34
+ displayName: "x64 Build"
35
+ - script : |
36
+ external\vcpkg\vcpkg.exe integrate install
37
+ external\vcpkg\vcpkg.exe install zlib:x86-windows-static bzip2:x86-windows-static
38
+ mkdir .\build\Windows\32
39
+ cd .\build\Windows\32
40
+ 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
41
+ cmake --build . --config Release
42
+ displayName: "x86 Build"
43
+ - task : ArchiveFiles@2
44
+ inputs :
45
+ rootFolderOrFile : build\Windows\64\lib\Release\zip.dll
46
+ includeRootFolder : false
47
+ archiveType : 7z
48
+ replaceExistingArchive : true
49
+ archiveFile : $(Build.ArtifactStagingDirectory)\libzip-windows-x86.7z
50
+ - task : ArchiveFiles@2
51
+ inputs :
52
+ rootFolderOrFile : build\Windows\64\lib\Release\zip.dll
53
+ includeRootFolder : false
54
+ archiveType : 7z
55
+ replaceExistingArchive : true
56
+ archiveFile : $(Build.ArtifactStagingDirectory)\libzip-windows-x64.7z
57
+ - task : PublishBuildArtifacts@1
58
+ displayName : upload artifacts
59
+ inputs :
60
+ artifactName : ' native'
61
+ pathtoPublish : $(Build.ArtifactStagingDirectory)
17
62
- job : buildlinux
18
63
pool :
19
64
vmImage : ubuntu-16.04
@@ -36,14 +81,14 @@ stages:
36
81
displayName: 'Build Linux x86'
37
82
- task : ArchiveFiles@2
38
83
inputs :
39
- rootFolderOrFile : build/Linux/32/lib/libzip.so.5.0
84
+ rootFolderOrFile : build/Linux/32/lib/libzip.so.5.1
40
85
includeRootFolder : false
41
86
archiveType : 7z
42
87
replaceExistingArchive : true
43
88
archiveFile : $(Build.ArtifactStagingDirectory)/libzip-linux-x86.7z
44
89
- task : ArchiveFiles@2
45
90
inputs :
46
- rootFolderOrFile : build/Linux/64/lib/libzip.so.5.0
91
+ rootFolderOrFile : build/Linux/64/lib/libzip.so.5.1
47
92
includeRootFolder : false
48
93
archiveType : 7z
49
94
replaceExistingArchive : true
@@ -54,21 +99,23 @@ stages:
54
99
artifactName : ' native'
55
100
pathtoPublish : $(Build.ArtifactStagingDirectory)
56
101
- job : build
57
- dependsOn : buildlinux
102
+ dependsOn :
103
+ - buildlinux
104
+ - buildWindows
58
105
pool :
59
- vmImage : xcode9-macos10.13
106
+ vmImage : macOS-10.14
60
107
steps :
61
108
- bash : |
62
- brew tap xamarin/xamarin-android-windeps
63
- brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/a6542037a48a55061a4c319e6bb174b3715f7cbe/Formula/mingw-w64.rb
64
- brew install mingw-w64 p7zip
65
- brew install ninja xamarin/xamarin-android-windeps/mingw-zlib
109
+ brew install p7zip ninja
66
110
git submodule update --init --recursive
67
111
- bash : |
68
112
HOSTOS=Darwin ./build_native
69
- ./build_windows
113
+ displayName: 'Build Darwin'
114
+ - bash : |
70
115
mkdir -p build/Linux/64
71
116
mkdir -p build/Linux/32
117
+ mkdir -p build/Windows/64
118
+ mkdir -p build/Windows/32
72
119
find build/* | grep libzip
73
120
- task : DownloadBuildArtifacts@0
74
121
displayName : download artifacts
@@ -85,10 +132,23 @@ stages:
85
132
inputs :
86
133
archiveFilePatterns : $(Build.ArtifactStagingDirectory)/native/libzip-linux-x86.7z
87
134
destinationFolder : build/Linux/32
135
+ - task : ExtractFiles@1
136
+ displayName : Extract 64 bit Windows native
137
+ inputs :
138
+ archiveFilePatterns : $(Build.ArtifactStagingDirectory)/native/libzip-windows-x64.7z
139
+ destinationFolder : build/Windows/64
140
+ - task : ExtractFiles@1
141
+ displayName : Extract 32 bit Windows native
142
+ inputs :
143
+ archiveFilePatterns : $(Build.ArtifactStagingDirectory)/native/libzip-windows-x86.7z
144
+ destinationFolder : build/Windows/32
88
145
- bash : |
89
- mv build/Linux/32/libzip.so.5.0 build/Linux/32/libzip.so
90
- mv build/Linux/64/libzip.so.5.0 build/Linux/64/libzip.so
146
+ mv build/Linux/32/libzip.so.5.1 build/Linux/32/libzip.so
147
+ mv build/Linux/64/libzip.so.5.1 build/Linux/64/libzip.so
148
+ mv build/Windows/32/zip.dll build/Windows/32/libzip.dll
149
+ mv build/Windows/64/zip.dll build/Windows/64/libzip.dll
91
150
rm $(Build.ArtifactStagingDirectory)/native/libzip-linux-*.7z
151
+ rm $(Build.ArtifactStagingDirectory)/native/libzip-windows-*.7z
92
152
displayName: 'Find libzip'
93
153
- task : MSBuild@1
94
154
displayName : ' Build solution libZipSharp.csproj'
@@ -136,22 +196,37 @@ stages:
136
196
solution : LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
137
197
configuration : Release
138
198
msbuildArguments : /restore /t:RunNunitTests /p:ReferenceNuget=True /v:diag
199
+ - task : DotNetCoreCLI@2
200
+ displayName : " Run Tests under .net Core"
201
+ inputs :
202
+ command : test
203
+ projects : ' LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
204
+ arguments : ' --configuration Release --framework netcoreapp3.1 --no-build'
139
205
- job : testmacos
140
206
displayName : ' Test MacOS'
141
207
pool :
142
- vmImage : xcode9-macos10.13
208
+ vmImage : macOS-10.14
143
209
steps :
144
210
- task : DownloadBuildArtifacts@0
145
211
displayName : download artifacts
146
212
inputs :
147
213
artifactName : NuGet
148
214
downloadPath : $(Build.SourcesDirectory)
215
+ - task : UseDotNet@2
216
+ inputs :
217
+ version : ' 3.1.x'
149
218
- task : MSBuild@1
150
219
displayName : ' Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
151
220
inputs :
152
221
solution : LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
153
222
configuration : Release
154
223
msbuildArguments : /restore /t:RunNunitTests /p:ReferenceNuget=True /v:diag
224
+ # - task: DotNetCoreCLI@2
225
+ # displayName: "Run Tests under .net Core"
226
+ # inputs:
227
+ # command: test
228
+ # projects: 'LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
229
+ # arguments: '--configuration Release --framework netcoreapp3.1 --no-build'
155
230
- job : testwindows
156
231
displayName : ' Test Windows'
157
232
pool :
@@ -163,11 +238,17 @@ stages:
163
238
artifactName : NuGet
164
239
downloadPath : $(Build.SourcesDirectory)
165
240
- task : MSBuild@1
166
- displayName : ' Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
241
+ displayName : ' Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj and Run tests '
167
242
inputs :
168
243
solution : LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
169
244
configuration : Release
170
245
msbuildArguments : /restore /t:RunNunitTests /p:ReferenceNuget=True /v:diag
246
+ - task : DotNetCoreCLI@2
247
+ displayName : " Run Tests under .net Core"
248
+ inputs :
249
+ command : test
250
+ projects : ' LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
251
+ arguments : ' --configuration Release --framework netcoreapp3.1 --no-build'
171
252
- stage : Publish
172
253
dependsOn : Test
173
254
condition : eq(variables['System.TeamProject'], 'devdiv') # only sign the packages when running on Windows, and using the private server which has the certificates
0 commit comments