Skip to content

Commit d5b1d15

Browse files
authored
Merge pull request #539 from dotnet/libgit2Update
Update libgit2sharp to 0.27.0-preview-0096
2 parents b3acc71 + 0544144 commit d5b1d15

File tree

8 files changed

+6
-567
lines changed

8 files changed

+6
-567
lines changed

src/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</PropertyGroup>
2222
<PropertyGroup>
2323
<!-- LibGit2Sharp Native Binary version - used in both main project and Cake addin -->
24-
<LibGit2SharpNativeVersion>2.0.306</LibGit2SharpNativeVersion>
24+
<LibGit2SharpNativeVersion>2.0.312</LibGit2SharpNativeVersion>
2525
</PropertyGroup>
2626
<ItemGroup>
2727
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="3.8.0-5.final" PrivateAssets="all" />

src/NerdBank.GitVersioning.Tests/LibGit2Loader.cs

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/NerdBank.GitVersioning.Tests/RepoTestBase.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ public abstract partial class RepoTestBase : IDisposable
1616

1717
public RepoTestBase(ITestOutputHelper logger)
1818
{
19-
#if NETCOREAPP
20-
LibGit2Loader.EnsureRegistered();
21-
#endif
22-
2319
Requires.NotNull(logger, nameof(logger));
2420

2521
this.Logger = logger;

src/NerdBank.GitVersioning/NerdBank.GitVersioning.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<PackageReference Include="DotNetMDDocs" Version="0.111.0" PrivateAssets="all" Condition=" '$(GenerateMarkdownApiDocs)' == 'true' " />
13-
<PackageReference Include="LibGit2Sharp" Version="0.26.2" PrivateAssets="none" />
13+
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0096" PrivateAssets="none" />
1414
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.1.0" />
1515
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
1616
<PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />

src/Nerdbank.GitVersioning.Tasks/GitLoaderContext.cs

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -24,69 +24,6 @@ protected override Assembly Load(AssemblyName assemblyName)
2424
? this.LoadFromAssemblyPath(path)
2525
: Default.LoadFromAssemblyName(assemblyName);
2626
}
27-
28-
protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
29-
{
30-
var modulePtr = IntPtr.Zero;
31-
32-
if (unmanagedDllName.StartsWith("git2-", StringComparison.Ordinal) ||
33-
unmanagedDllName.StartsWith("libgit2-", StringComparison.Ordinal))
34-
{
35-
var directory = GetNativeLibraryDirectory();
36-
var extension = GetNativeLibraryExtension();
37-
38-
if (!unmanagedDllName.EndsWith(extension, StringComparison.Ordinal))
39-
{
40-
unmanagedDllName += extension;
41-
}
42-
43-
var nativeLibraryPath = Path.Combine(directory, unmanagedDllName);
44-
if (!File.Exists(nativeLibraryPath))
45-
{
46-
nativeLibraryPath = Path.Combine(directory, "lib" + unmanagedDllName);
47-
}
48-
49-
modulePtr = this.LoadUnmanagedDllFromPath(nativeLibraryPath);
50-
}
51-
52-
return (modulePtr != IntPtr.Zero) ? modulePtr : base.LoadUnmanagedDll(unmanagedDllName);
53-
}
54-
55-
internal static string GetNativeLibraryDirectory()
56-
{
57-
var dir = Path.GetDirectoryName(typeof(GitLoaderContext).Assembly.Location);
58-
59-
// When invoked as a MSBuild task, the native libraries will be at
60-
// ../runtimes. When invoked from the nbgv CLI, the libraries
61-
// will be at ./runtimes.
62-
string runtimePath = RuntimePath;
63-
if (!Directory.Exists(Path.Combine(dir, runtimePath)))
64-
{
65-
runtimePath = "." + runtimePath;
66-
}
67-
68-
return Path.Combine(dir, runtimePath, RuntimeIdMap.GetNativeLibraryDirectoryName(RuntimeEnvironment.GetRuntimeIdentifier()), "native");
69-
}
70-
71-
private static string GetNativeLibraryExtension()
72-
{
73-
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
74-
{
75-
return ".dll";
76-
}
77-
78-
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
79-
{
80-
return ".dylib";
81-
}
82-
83-
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
84-
{
85-
return ".so";
86-
}
87-
88-
throw new PlatformNotSupportedException();
89-
}
9027
}
9128
}
9229
#endif

src/Nerdbank.GitVersioning.Tasks/Nerdbank.GitVersioning.nuspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ IMPORTANT: The 3.x release may produce a different version height than prior maj
3030
<file src="$LibGit2SharpNativeBinaries$runtimes\**" target="build\runtimes\" />
3131

3232
<!-- Additional copies to work around DllNotFoundException on Mono (https://github.com/dotnet/Nerdbank.GitVersioning/issues/222) -->
33-
<file src="$LibGit2SharpNativeBinaries$runtimes\osx\native\libgit2-106a5f2.dylib" target="build\MSBuildFull\lib\osx\libgit2-106a5f2.dylib" />
34-
<file src="$LibGit2SharpNativeBinaries$runtimes\linux-x64\native\libgit2-106a5f2.so" target="build\MSBuildFull\lib\linux-x64\libgit2-106a5f2.so" />
33+
<file src="$LibGit2SharpNativeBinaries$runtimes\osx\native\libgit2-6777db8.dylib" target="build\MSBuildFull\lib\osx\libgit2-6777db8.dylib" />
34+
<file src="$LibGit2SharpNativeBinaries$runtimes\linux-x64\native\libgit2-6777db8.so" target="build\MSBuildFull\lib\linux-x64\libgit2-6777db8.so" />
3535

3636
<!-- Additional copies to work with our own ps1 scripts (https://github.com/dotnet/Nerdbank.GitVersioning/issues/248) -->
37-
<file src="$LibGit2SharpNativeBinaries$runtimes\win-x64\native\git2-106a5f2.dll" target="build\MSBuildFull\lib\win32\x64\git2-106a5f2.dll" />
38-
<file src="$LibGit2SharpNativeBinaries$runtimes\win-x86\native\git2-106a5f2.dll" target="build\MSBuildFull\lib\win32\x86\git2-106a5f2.dll" />
37+
<file src="$LibGit2SharpNativeBinaries$runtimes\win-x64\native\git2-6777db8.dll" target="build\MSBuildFull\lib\win32\x64\git2-6777db8.dll" />
38+
<file src="$LibGit2SharpNativeBinaries$runtimes\win-x86\native\git2-6777db8.dll" target="build\MSBuildFull\lib\win32\x86\git2-6777db8.dll" />
3939

4040
<file src="$LibGit2SharpNativeBinaries$libgit2\LibGit2Sharp.dll.config" target="build\MSBuildCore\LibGit2Sharp.dll.config" />
4141
<file src="$BaseOutputPath$netcoreapp2.1\LibGit2Sharp.dll" target="build\MSBuildCore\LibGit2Sharp.dll" />

0 commit comments

Comments
 (0)