8000 FINALLY! Update LibGit2Sharp for NET Standard · PoshCode/PSGit@cfc6593 · GitHub
[go: up one dir, main page]

Skip to content

Commit cfc6593

Browse files
committed
FINALLY! Update LibGit2Sharp for NET Standard
Switch to loading at runtime because of NativeBinary path issues.
1 parent 19baff2 commit cfc6593

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

Build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ param(
1717
# The default supports PS3: "net40","net35","net20","net45"
1818
# To only support PS4, use: "net45","net40","net35","net20"
1919
# To support PS2, you use: "net35","net20"
20-
[string[]]$TargetFramework = @("net40","net35","net20","net45"),
20+
[string[]]$TargetFramework = @("net40","net35","net20","net45","netstandard2.0"),
2121

2222
# The revision number (pulled from the environment in AppVeyor)
2323
[Nullable[int]]$RevisionNumber = ${Env:APPVEYOR_BUILD_NUMBER},
@@ -205,9 +205,9 @@ function build {
205205
$LibPath = "$ReleasePath\lib"
206206
$folder = Join-Path $Path "packages\$($Package.id)*"
207207

208-
# The git NativeBinaries are special -- we need to copy all the "windows" binaries:
208+
# The git NativeBinaries are special -- we need to copy all the binaries:
209209
if($Package.id -eq "LibGit2Sharp.NativeBinaries") {
210-
$targets = Join-Path $folder 'libgit2\windows'
210+
$targets = Join-Path $folder 'runtimes'
211211
$LibPath = Join-Path $LibPath "NativeBinaries"
212212
} else {
213213
# Check for each TargetFramework, in order of preference, fall back to using the lib folder

packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="LibGit2Sharp.NativeBinaries" version="1.0.129" allowedVersions="[1.0,1.0)" source="https://www.nuget.org/api/v2" />
4-
<package id="LibGit2Sharp" version="0.22.0" allowedVersions="[0.22.0,1.0)" source="https://www.nuget.org/api/v2" />
3+
<package id="LibGit2Sharp.NativeBinaries" version="1.0.210" allowedVersions="[1.0,1.0)" source="https://www.nuget.org/api/v2" />
4+
<package id="LibGit2Sharp" version="0.25.0" allowedVersions="[0.22.0,1.0)" source="https://www.nuget.org/api/v2" />
55
</packages>

src/PSGit.psm1

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# try {
2+
# $IsWindows = [Runtime.InteropServices.RuntimeInformation]::IsOSPlatform( [Runtime.InteropServices.OSPlatform]::Windows )
3+
# $IsLinux = [Runtime.InteropServices.RuntimeInformation]::IsOSPlatform( [RUntime.InteropServices.OSPlatform]::Linux )
4+
# $IsOSX = [Runtime.InteropServices.RuntimeInformation]::IsOSPlatform( [RUntime.InteropServices.OSPlatform]::OSX )
5+
# } catch {}
6+
# $Arch = "-" + [Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture
7+
8+
Get-ChildItem -Directory -Path $PSScriptRoot\runtimes\ -Recurse -Filter 'native' |
9+
ForEach-Object {
10+
# For windows
11+
$env:PATH = '{0}{1}{2}' -f @(
12+
$_.FullName
13+
[System.IO.Path]::PathSeparator
14+
$env:PATH
15+
)
16+
# For Linux
17+
$env:LD_LIBRARY_PATH = '{0}{1}{2}' -f @(
18+
$_.FullName
19+
[System.IO.Path]::PathSeparator
20+
$env:LD_LIBRARY_PATH
21+
)
22+
# For macOS
23+
$env:DYLD_LIBRARY_PATH = '{0}{1}{2}' -f @(
24+
$_.FullName
25+
[System.IO.Path]::PathSeparator
26+
$env:DYLD_LIBRARY_PATH
27+
)
28+
}
29+
130
# Internal Functions
231
#region Interal Functions
332
function WriteMessage {

0 commit comments

Comments
 (0)
0