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 embeds SSH at the path pointed to by the value.
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
+ [string ]$ssh = ' '
22
25
)
23
26
24
27
Set-StrictMode - Version Latest
@@ -28,12 +31,19 @@ $libgit2sharpDirectory = Split-Path $MyInvocation.MyCommand.Path
28
31
$libgit2Directory = Join-Path $libgit2sharpDirectory " libgit2"
29
32
$x86Directory = Join-Path $libgit2sharpDirectory " Lib\NativeBinaries\x86"
30
33
$x64Directory = Join-Path $libgit2sharpDirectory " Lib\NativeBinaries\amd64"
34
+ $sshFile = Join-Path $libgit2sharpDirectory " LibGit2Sharp.Tests\ssh_used.txt"
31
35
32
36
$build_clar = ' OFF'
33
37
if ($test.IsPresent ) { $build_clar = ' ON' }
34
38
$configuration = " RelWithDebInfo"
35
39
if ($debug.IsPresent ) { $configuration = " Debug" }
36
40
41
+ if (! [string ]::IsNullOrEmpty($libgit2Name )) {
42
+ $embed_ssh = ' -DEMBED_SSH_PATH="$ssh"'
43
+ } else {
44
+ $embed_ssh = ' '
45
+ }
46
+
37
47
function Run-Command ([scriptblock ]$Command , [switch ]$Fatal , [switch ]$Quiet ) {
38
48
$output = " "
39
49
if ($Quiet ) {
@@ -144,7 +154,7 @@ function Assert-Consistent-Naming($expected, $path) {
144
154
Run- Command - Quiet { & remove-item build - recurse - force }
145
155
Run- Command - Quiet { & mkdir build }
146
156
cd build
147
- Run- Command - Quiet - Fatal { & $cmake - G " Visual Studio $vs " - D ENABLE_TRACE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " - DSTDCALL= ON .. }
157
+ Run- Command - Quiet - Fatal { & $cmake - G " Visual Studio $vs " - D THREADSAFE = ON - D ENABLE_TRACE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " - DSTDCALL= ON $embed_ssh .. }
148
158
Run- Command - Quiet - Fatal { & $cmake -- build . -- config $configuration }
149
159
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
150
160
cd $configuration
@@ -157,7 +167,7 @@ function Assert-Consistent-Naming($expected, $path) {
157
167
cd ..
158
168
Run- Command - Quiet { & mkdir build64 }
159
169
cd build64
160
- Run- Command - Quiet - Fatal { & $cmake - G " Visual Studio $vs Win64" - D THREADSAFE= ON - D ENABLE_TRACE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " - DSTDCALL= ON ../ .. }
170
+ Run- Command - Quiet - Fatal { & $cmake - G " Visual Studio $vs Win64" - D THREADSAFE= ON - D ENABLE_TRACE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " - DSTDCALL= ON $embed_ssh ../ .. }
161
171
Run- Command - Quiet - Fatal { & $cmake -- build . -- config $configuration }
162
172
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
163
173
cd $configuration
@@ -180,6 +190,7 @@ namespace LibGit2Sharp.Core
180
190
181
191
sc - Encoding ASCII (Join-Path $libgit2sharpDirectory " Libgit2sharp\Core\NativeDllName.cs" ) $dllNameClass
182
192
sc - Encoding ASCII (Join-Path $libgit2sharpDirectory " Libgit2sharp\libgit2_hash.txt" ) $sha
193
+ sc - Encoding ASCII (Join-Path $libgit2sharpDirectory " Libgit2sharp.Tests\ssh_used.txt" ) (! [string ]::IsNullOrEmpty($ssh ))
183
194
184
195
$buildProperties = @"
185
196
<?xml version="1.0" encoding="utf-8"?>
0 commit comments