Skip to content

Commit 6a92ac9

Browse files
committed
Only deploy Windows native libraries on Windows
Fix #813
1 parent 8da55e5 commit 6a92ac9

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

LibGit2Sharp.Tests/ShadowCopyFixture.cs

+12-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace LibGit2Sharp.Tests
1010
{
1111
public class ShadowCopyFixture : BaseFixture
1212
{
13-
[SkippableFact]
13+
[Fact]
1414
public void CanProbeForNativeBinariesFromAShadowCopiedAssembly()
1515
{
1616
Type type = typeof(Wrapper);
@@ -62,13 +62,17 @@ public void CanProbeForNativeBinariesFromAShadowCopiedAssembly()
6262
string cachedAssembliesPath = Path.Combine(setup.CachePath, setup.ApplicationName);
6363
Assert.True(cachedAssemblyLocation.StartsWith(cachedAssembliesPath));
6464

65-
// ...that this cache doesn't contain the `NativeBinaries` folder
66-
string cachedAssemblyParentPath = Path.GetDirectoryName(cachedAssemblyLocation);
67-
Assert.False(Directory.Exists(Path.Combine(cachedAssemblyParentPath, "NativeBinaries")));
68-
69-
// ...whereas `NativeBinaries` of course exists next to the source assembly
70-
string sourceAssemblyParentPath = Path.GetDirectoryName(new Uri(sourceAssembly.EscapedCodeBase).LocalPath);
71-
Assert.True(Directory.Exists(Path.Combine(sourceAssemblyParentPath, "NativeBinaries")));
65+
if (!IsRunningOnLinux())
66+
{
67+
// ...that this cache doesn't contain the `NativeBinaries` folder
68+
string cachedAssemblyParentPath = Path.GetDirectoryName(cachedAssemblyLocation);
69+
Assert.False(Directory.Exists(Path.Combine(cachedAssemblyParentPath, "NativeBinaries")));
70+
71+
// ...whereas `NativeBinaries` of course exists next to the source assembly
72+
string sourceAssemblyParentPath =
73+
Path.GetDirectoryName(new Uri(sourceAssembly.EscapedCodeBase).LocalPath);
74+
Assert.True(Directory.Exists(Path.Combine(sourceAssemblyParentPath, "NativeBinaries")));
75+
}
7276

7377
AppDomain.Unload(domain);
7478
}

LibGit2Sharp/CopyWindowsNativeDependencies.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Target Name="AfterBuild">
3+
<Target Name="AfterBuild" Condition="'$(OS)' == 'Windows_NT'">
44
<CreateItem Include="$(NativeBinariesDirectory)\**\*.*">
55
<Output TaskParameter="Include" ItemName="NativeBinaries" />
66
</CreateItem>

0 commit comments

Comments
 (0)