Skip to content

Commit dede983

Browse files
committed
Update/build scripts: allow custom DLL names
Allow custom shared library names (eg, `git2-mycompany.dll` instead of `git2-hash.dll`) to allow a single process to potentially load multiple instances of libgit2.
1 parent e9c5450 commit dede983

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

UpdateLibgit2ToSha.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
#>
77

88
Param(
9-
[string]$sha = 'HEAD'
9+
[string]$sha = 'HEAD',
10+
[string]$libgit2Name = ''
1011
)
1112

1213
Set-StrictMode -Version Latest
@@ -83,7 +84,11 @@ Push-Location $libgit2Directory
8384

8485
sc -Encoding ASCII (Join-Path $projectDirectory "nuget.package\libgit2\libgit2_hash.txt") $sha
8586

86-
$binaryFilename = "git2-" + $sha.Substring(0,7)
87+
if (![string]::IsNullOrEmpty($libgit2Name)) {
88+
$binaryFilename = $libgit2Name
89+
} else {
90+
$binaryFilename = "git2-" + $sha.Substring(0,7)
91+
}
8792

8893
$buildProperties = @"
8994
<?xml version="1.0" encoding="utf-8"?>

build.libgit2.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
Param(
1313
[string]$vs = '10',
14+
[string]$libgit2Name = '',
1415
[switch]$test,
1516
[switch]$debug
1617
)
@@ -23,7 +24,12 @@ $x86Directory = Join-Path $projectDirectory "nuget.package\libgit2\windows\x86"
2324
$x64Directory = Join-Path $projectDirectory "nuget.package\libgit2\windows\amd64"
2425
$hashFile = Join-Path $projectDirectory "nuget.package\libgit2\libgit2_hash.txt"
2526
$sha = Get-Content $hashFile
26-
$binaryFilename = "git2-" + $sha.Substring(0,7)
27+
28+
if (![string]::IsNullOrEmpty($libgit2Name)) {
29+
$binaryFilename = $libgit2Name
30+
} else {
31+
$binaryFilename = "git2-" + $sha.Substring(0,7)
32+
}
2733

2834
$build_clar = 'OFF'
2935
if ($test.IsPresent) { $build_clar = 'ON' }

0 commit comments

Comments
 (0)