8000 SSH API Implementation by Therzok · Pull Request #852 · libgit2/libgit2sharp · GitHub
[go: up one dir, main page]

Skip to content

SSH API Implementation #852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Introduce SSH linking in the scripts.
  • Loading branch information
Therzok committed Apr 5, 2015
commit 8000ec8155cfb6644a64a78c07bd316f2bb121ab
Binary file modified Lib/NativeBinaries/amd64/git2-9bbc8f3.dll
Binary file not shown.
Binary file modified Lib/NativeBinaries/amd64/git2-9bbc8f3.pdb
Binary file not shown.
Binary file modified Lib/NativeBinaries/x86/git2-9bbc8f3.dll
Binary file not shown.
Binary file modified Lib/NativeBinaries/x86/git2-9bbc8f3.pdb
Binary file not shown.
10 changes: 10 additions & 0 deletions LibGit2Sharp.Tests/GlobalSettingsFixture.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Text.RegularExpressions;
using LibGit2Sharp.Tests.TestHelpers;
using Xunit;
using System.Globalization;
using System.IO;

namespace LibGit2Sharp.Tests
{
Expand All @@ -13,6 +15,14 @@ public void CanGetMinimumCompiledInFeatures()

Assert.True(features.HasFlag(BuiltInFeatures.Threads));
Assert.True(features.HasFlag(BuiltInFeatures.Https));

bool hasSsh;
using (var sr = new StreamReader(typeof(GlobalSettingsFixture).Assembly.GetManifestResourceStream("LibGit2Sharp.Tests.ssh_used.txt")))
{
if (!bool.TryParse(sr.ReadLine(), out hasSsh))
hasSsh = false;
}
Assert.Equal(hasSsh, features.HasFlag(BuiltInFeatures.Ssh));
}

[Fact]
Expand Down
3 changes: 3 additions & 0 deletions LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,7 @@
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<EmbeddedResource Include="ssh_used.txt" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions LibGit2Sharp.Tests/ssh_used.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
False
17 changes: 14 additions & 3 deletions UpdateLibgit2ToSha.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
If set, run the libgit2 tests on the desired version.
.PARAMETER debug
If set, build the "Debug" configuration of libgit2, rather than "RelWithDebInfo" (default).
.PARAMETER ssh
If set embeds SSH at the path pointed to by the value.
#>

Param(
[string]$sha = 'HEAD',
[string]$vs = '10',
[string]$libgit2Name = '',
[switch]$test,
[switch]$debug
[switch]$debug,
[string]$ssh = ''
)

Set-StrictMode -Version Latest
Expand All @@ -28,12 +31,19 @@ $libgit2sharpDirectory = Split-Path $MyInvocation.MyCommand.Path
$libgit2Directory = Join-Path $libgit2sharpDirectory "libgit2"
$x86Directory = Join-Path $libgit2sharpDirectory "Lib\NativeBinaries\x86"
$x64Directory = Join-Path $libgit2sharpDirectory "Lib\NativeBinaries\amd64"
$sshFile = Join-Path $libgit2sharpDirectory "LibGit2Sharp.Tests\ssh_used.txt"

$build_clar = 'OFF'
if ($test.IsPresent) { $build_clar = 'ON' }
$configuration = "RelWithDebInfo"
if ($debug.IsPresent) { $configuration = "Debug" }

if (![string]::IsNullOrEmpty($libgit2Name)) {
$embed_ssh = '-DEMBED_SSH_PATH="$ssh"'
} else {
$embed_ssh = ''
}

function Run-Command([scriptblock]$Command, [switch]$Fatal, [switch]$Quiet) {
$output = ""
if ($Quiet) {
Expand Down Expand Up @@ -144,7 +154,7 @@ function Assert-Consistent-Naming($expected, $path) {
Run-Command -Quiet { & remove-item build -recurse -force }
Run-Command -Quiet { & mkdir build }
cd build
Run-Command -Quiet -Fatal { & $cmake -G "Visual Studio $vs" -D ENABLE_TRACE=ON -D "BUILD_CLAR=$build_clar" -D "LIBGIT2_FILENAME=$binaryFilename" -DSTDCALL=ON .. }
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 .. }
Run-Command -Quiet -Fatal { & $cmake --build . --config $configuration }
if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } }
cd $configuration
Expand All @@ -157,7 +167,7 @@ function Assert-Consistent-Naming($expected, $path) {
cd ..
Run-Command -Quiet { & mkdir build64 }
cd build64
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 ../.. }
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 ../.. }
Run-Command -Quiet -Fatal { & $cmake --build . --config $configuration }
if ($test.IsPresent) { Run-Command -Quiet -Fatal { & $ctest -V . } }
cd $configuration
Expand All @@ -180,6 +190,7 @@ namespace LibGit2Sharp.Core

sc -Encoding ASCII (Join-Path $libgit2sharpDirectory "Libgit2sharp\Core\NativeDllName.cs") $dllNameClass
sc -Encoding ASCII (Join-Path $libgit2sharpDirectory "Libgit2sharp\libgit2_hash.txt") $sha
sc -Encoding ASCII (Join-Path $libgit2sharpDirectory "Libgit2sharp.Tests\ssh_used.txt") (![string]::IsNullOrEmpty($ssh))

$buildProperties = @"
<?xml version="1.0" encoding="utf-8"?>
Expand Down
8 changes: 7 additions & 1 deletion build.libgit2sharp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
LIBGIT2SHA=`cat ./LibGit2Sharp/libgit2_hash.txt`
SHORTSHA=${LIBGIT2SHA:0:7}
EXTRADEFINE="$1"
USESSH=${1-OFF}
SSH_FILE="LibGit2Sharp.Tests/ssh_used.txt"

rm -rf libgit2/build
mkdir libgit2/build
Expand All @@ -11,13 +13,17 @@ export _BINPATH=`pwd`

cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DBUILD_CLAR:BOOL=OFF \
-DUSE_SSH=OFF \
-DUSE_SSH=$USESSH \
-DENABLE_TRACE=ON \
-DLIBGIT2_FILENAME=git2-$SHORTSHA \
-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
..
cmake --build .

shopt -s nocasematch
[[ USESSH == "ON" ]] && echo "True" > $SSH_FILE || echo "False" > $SSH_FILE
shopt -u nocasematch

export LD_LIBRARY_PATH=$_BINPATH:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$_BINPATH:$DYLD_LIBRARY_PATH

Expand Down
0