diff --git a/UpdateLibgit2ToSha.ps1 b/UpdateLibgit2ToSha.ps1 index c073d592..72802528 100644 --- a/UpdateLibgit2ToSha.ps1 +++ b/UpdateLibgit2ToSha.ps1 @@ -16,7 +16,7 @@ $self = Split-Path -Leaf $MyInvocation.MyCommand.Path $projectDirectory = Split-Path $MyInvocation.MyCommand.Path $libgit2Directory = Join-Path $projectDirectory "libgit2" -function Run-Command([scriptblock]$Command, [switch]$Fatal, [switch]$Quiet) { +function Invoke-Command([scriptblock]$Command, [switch]$Fatal, [switch]$Quiet) { $output = "" if ($Quiet) { $output = & $Command 2>&1 @@ -67,18 +67,18 @@ Push-Location $libgit2Directory $git = Find-Git Write-Output "Fetching..." - Run-Command -Quiet { & $git fetch } + Invoke-Command -Quiet { & $git fetch } Write-Output "Verifying $sha..." $sha = & $git rev-parse $sha if ($LASTEXITCODE -ne 0) { write-host -foregroundcolor red "Error: invalid SHA. USAGE: $self " - popd + Pop-Location break } Write-Output "Checking out $sha..." - Run-Command -Quiet -Fatal { & $git checkout $sha } + Invoke-Command -Quiet -Fatal { & $git checkout $sha } Pop-Location @@ -88,46 +88,63 @@ Push-Location $libgit2Directory $binaryFilename = "git2-" + $sha.Substring(0,7) } - sc -Encoding ASCII (Join-Path $projectDirectory "nuget.package\contentFiles\any\any\libgit2_hash.txt") $sha - sc -Encoding ASCII (Join-Path $projectDirectory "nuget.package\contentFiles\any\any\libgit2_filename.txt") $binaryFilename + Set-Content -Encoding ASCII (Join-Path $projectDirectory "nuget.package\libgit2\libgit2_hash.txt") $sha $buildProperties = @" - - - - - lib\win32\x64\$binaryFilename.dll - PreserveNewest - - - lib\win32\x64\$binaryFilename.pdb - PreserveNewest - - - lib\win32\x86\$binaryFilename.dll - PreserveNewest - - - lib\win32\x86\$binaryFilename.pdb - PreserveNewest - - - lib\osx\lib$binaryFilename.dylib - PreserveNewest - - - lib\linux\x86_64\lib$binaryFilename.so - PreserveNewest - - - LibGit2Sharp.dll.config - PreserveNewest - - + + + `$(MSBuildAllProjects);`$(MSBuildThisFileFullPath) + `$(MSBuildThisFileFullPath) + $sha + $binaryFilename + + +"@ + + Set-Content -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\build\LibGit2Sharp.NativeBinaries.props") $buildProperties + + $net461BuildProperties = @" + + + `$(MSBuildAllProjects);`$(MSBuildThisFileFullPath) + `$(MSBuildThisFileFullPath) + $sha + $binaryFilename + + + + lib\win32\x64\$binaryFilename.dll + PreserveNewest + + + lib\win32\x64\$binaryFilename.pdb + PreserveNewest + + + lib\win32\x86\$binaryFilename.dll + PreserveNewest + + + lib\win32\x86\$binaryFilename.pdb + PreserveNewest + + + lib\osx\lib$binaryFilename.dylib + PreserveNewest + + + lib\linux\x86_64\lib$binaryFilename.so + PreserveNewest + + + LibGit2Sharp.dll.config + PreserveNewest + + "@ - sc -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\build\net40\LibGit2Sharp.NativeBinaries.props") $buildProperties + Set-Content -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\build\net461\LibGit2Sharp.NativeBinaries.props") $net461BuildProperties $dllConfig = @" @@ -136,7 +153,7 @@ Push-Location $libgit2Directory "@ - sc -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\libgit2\LibGit2Sharp.dll.config") $dllConfig + Set-Content -Encoding UTF8 (Join-Path $projectDirectory "nuget.package\libgit2\LibGit2Sharp.dll.config") $dllConfig Write-Output "Done!" } diff --git a/build.libgit2.ps1 b/build.libgit2.ps1 index 9eb1be23..6e683e40 100644 --- a/build.libgit2.ps1 +++ b/build.libgit2.ps1 @@ -22,7 +22,7 @@ $projectDirectory = Split-Path $MyInvocation.MyCommand.Path $libgit2Directory = Join-Path $projectDirectory "libgit2" $x86Directory = Join-Path $projectDirectory "nuget.package\runtimes\win7-x86\native" $x64Directory = Join-Path $projectDirectory "nuget.package\runtimes\win7-x64\native" -$hashFile = Join-Path $projectDirectory "nuget.package\contentFiles\any\any\libgit2_hash.txt" +$hashFile = Join-Path $projectDirectory "nuget.package\libgit2\libgit2_hash.txt" $sha = Get-Content $hashFile if (![string]::IsNullOrEmpty($libgit2Name)) { diff --git a/build.libgit2.sh b/build.libgit2.sh index 0676b098..61a6b269 100755 --- a/build.libgit2.sh +++ b/build.libgit2.sh @@ -1,6 +1,6 @@ #!/bin/bash -LIBGIT2SHA=`cat ./nuget.package/contentFiles/any/any/libgit2_hash.txt` +LIBGIT2SHA=`cat ./nuget.package/libgit2/libgit2_hash.txt` SHORTSHA=${LIBGIT2SHA:0:7} rm -rf libgit2/build diff --git a/nuget.package/NativeBinaries.nuspec b/nuget.package/NativeBinaries.nuspec index ea37928b..360bfb72 100644 --- a/nuget.package/NativeBinaries.nuspec +++ b/nuget.package/NativeBinaries.nuspec @@ -1,17 +1,14 @@  - - LibGit2Sharp.NativeBinaries - 1.0.155 - LibGit2Sharp contributors - nulltoken - https://raw.githubusercontent.com/libgit2/libgit2/master/COPYING - https://github.com/libgit2/libgit2sharp.nativebinaries - https://raw.githubusercontent.com/libgit2/libgit2sharp/master/square-logo.png - false - Native binaries for LibGit2Sharp - - - - + + LibGit2Sharp.NativeBinaries + 1.0.155 + LibGit2Sharp contributors + nulltoken + https://raw.githubusercontent.com/libgit2/libgit2/master/COPYING + https://github.com/libgit2/libgit2sharp.nativebinaries + https://raw.githubusercontent.com/libgit2/libgit2sharp/master/square-logo.png + false + Native binaries for LibGit2Sharp + diff --git a/nuget.package/build/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/LibGit2Sharp.NativeBinaries.props new file mode 100644 index 00000000..0f19fc60 --- /dev/null +++ b/nuget.package/build/LibGit2Sharp.NativeBinaries.props @@ -0,0 +1,8 @@ + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + $(MSBuildThisFileFullPath) + 15e119375018fba121cf58e02a9f17fe22df0df8 + git2-15e1193 + + diff --git a/nuget.package/build/net40/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/net40/LibGit2Sharp.NativeBinaries.props deleted file mode 100644 index c6d2ddb1..00000000 --- a/nuget.package/build/net40/LibGit2Sharp.NativeBinaries.props +++ /dev/null @@ -1,33 +0,0 @@ - - - - - lib\win32\x64\git2-15e1193.dll - PreserveNewest - - - lib\win32\x64\git2-15e1193.pdb - PreserveNewest - - - lib\win32\x86\git2-15e1193.dll - PreserveNewest - - - lib\win32\x86\git2-15e1193.pdb - PreserveNewest - - - lib\osx\libgit2-15e1193.dylib - PreserveNewest - - - lib\linux\x86_64\libgit2-15e1193.so - PreserveNewest - - - LibGit2Sharp.dll.config - PreserveNewest - - - diff --git a/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props new file mode 100644 index 00000000..184e5b36 --- /dev/null +++ b/nuget.package/build/net461/LibGit2Sharp.NativeBinaries.props @@ -0,0 +1,38 @@ + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + $(MSBuildThisFileFullPath) + 15e119375018fba121cf58e02a9f17fe22df0df8 + git2-15e1193 + + + + lib\win32\x64\git2-15e1193.dll + PreserveNewest + + + lib\win32\x64\git2-15e1193.pdb + PreserveNewest + + + lib\win32\x86\git2-15e1193.dll + PreserveNewest + + + lib\win32\x86\git2-15e1193.pdb + PreserveNewest + + + lib\osx\libgit2-15e1193.dylib + PreserveNewest + + + lib\linux\x86_64\libgit2-15e1193.so + PreserveNewest + + + LibGit2Sharp.dll.config + PreserveNewest + + + diff --git a/nuget.package/contentFiles/any/any/libgit2_filename.txt b/nuget.package/contentFiles/any/any/libgit2_filename.txt deleted file mode 100644 index d5bd7b7e..00000000 --- a/nuget.package/contentFiles/any/any/libgit2_filename.txt +++ /dev/null @@ -1 +0,0 @@ -git2-15e1193 diff --git a/nuget.package/contentFiles/any/any/libgit2_hash.txt b/nuget.package/libgit2/libgit2_hash.txt similarity index 100% rename from nuget.package/contentFiles/any/any/libgit2_hash.txt rename to nuget.package/libgit2/libgit2_hash.txt