11
11
If set, run the libgit2 tests on the desired version.
12
12
. PARAMETER debug
13
13
If set, build the "Debug" configuration of libgit2, rather than "RelWithDebInfo" (default).
14
+ . PARAMETER ssh
15
+ If set, build with SSH enabled.
14
16
#>
15
17
16
18
Param (
17
19
[string ]$sha = ' HEAD' ,
18
20
[string ]$vs = ' 10' ,
19
21
[string ]$libgit2Name = ' ' ,
20
22
[switch ]$test ,
21
- [switch ]$debug
23
+ [switch ]$debug ,
24
+ [switch ]$ssh
22
25
)
23
26
24
27
Set-StrictMode - Version Latest
@@ -33,7 +36,8 @@ $build_clar = 'OFF'
33
36
if ($test.IsPresent ) { $build_clar = ' ON' }
34
37
$configuration = " RelWithDebInfo"
35
38
if ($debug.IsPresent ) { $configuration = " Debug" }
36
-
39
+ $embed_ssh = ' '
40
+ if ($ssh.IsPresent ) { $embed_ssh = ' -DEMBED_SSH_PATH="../../libssh2"' }
37
41
function Run-Command ([scriptblock ]$Command , [switch ]$Fatal , [switch ]$Quiet ) {
38
42
$output = " "
39
43
if ($Quiet ) {
@@ -144,7 +148,7 @@ function Assert-Consistent-Naming($expected, $path) {
144
148
Run- Command - Quiet { & remove-item build - recurse - force }
145
149
Run- Command - Quiet { & mkdir build }
146
150
cd build
147
- Run- Command - Quiet - Fatal { & $cmake - G " Visual Studio $vs " - D THREADSAFE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " - DSTDCALL= ON .. }
151
+ Run- Command - Quiet - Fatal { & $cmake - G " Visual Studio $vs " - D THREADSAFE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " - DSTDCALL= ON $embed_ssh .. }
148
152
Run- Command - Quiet - Fatal { & $cmake -- build . -- config $configuration }
149
153
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
150
154
cd $configuration
@@ -157,7 +161,7 @@ function Assert-Consistent-Naming($expected, $path) {
157
161
cd ..
158
162
Run- Command - Quiet { & mkdir build64 }
159
163
cd build64
160
- Run- Command - Quiet - Fatal { & $cmake - G " Visual Studio $vs Win64" - D THREADSAFE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " - DSTDCALL= ON ../ .. }
164
+ Run- Command - Quiet - Fatal { & $cmake - G " Visual Studio $vs Win64" - D THREADSAFE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " - DSTDCALL= ON $embed_ssh ../ .. }
161
165
Run- Command - Quiet - Fatal { & $cmake -- build . -- config $configuration }
162
166
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
163
167
cd $configuration
@@ -180,6 +184,7 @@ namespace LibGit2Sharp.Core
180
184
181
185
sc - Encoding ASCII (Join-Path $libgit2sharpDirectory " Libgit2sharp\Core\NativeDllName.cs" ) $dllNameClass
182
186
sc - Encoding ASCII (Join-Path $libgit2sharpDirectory " Libgit2sharp\libgit2_hash.txt" ) $sha
187
+ sc - Encoding ASCII (Join-Path $libgit2sharpDirectory " Libgit2sharp.Tests\Resources\ssh_used.txt" ) $ssh.IsPresent
183
188
184
189
Write-Output " Done!"
185
190
}
0 commit comments