Skip to content

Commit 668fb5d

Browse files
bordingnulltoken
authored andcommitted
Rebase fixups: SourceLink stuff
1 parent b8d8014 commit 668fb5d

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

nuget.package/BuildNugetPackage.ps1

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
Param(
1010
[Parameter(Mandatory=$true)]
11-
[string]$commitSha
11+
[string]$commitSha,
12+
[scriptblock]$postBuild
1213
)
1314

1415
$ErrorActionPreference = "Stop"
@@ -51,10 +52,19 @@ function Clean-OutputFolder($folder) {
5152
}
5253
}
5354

55+
# From http://www.dougfinke.com/blog/index.php/2010/12/01/note-to-self-how-to-programmatically-get-the-msbuild-path-in-powershell/
56+
57+
Function Get-MSBuild {
58+
$lib = [System.Runtime.InteropServices.RuntimeEnvironment]
59+
$rtd = $lib::GetRuntimeDirectory()
60+
Join-Path $rtd msbuild.exe
61+
}
62+
5463
#################
5564

5665
$root = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
5766
$projectPath = Join-Path $root "..\LibGit2Sharp"
67+
$slnPath = Join-Path $projectPath "..\LibGit2Sharp.sln"
5868

5969
Remove-Item (Join-Path $projectPath "*.nupkg")
6070

@@ -68,9 +78,15 @@ Push-Location $projectPath
6878

6979
try {
7080
Set-Content -Encoding ASCII $(Join-Path $projectPath "libgit2sharp_hash.txt") $commitSha
71-
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Restore "$(Join-Path $projectPath "..\LibGit2Sharp.sln")" }
81+
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Restore "$slnPath" }
82+
Run-Command { & (Get-MSBuild) "$slnPath" "/verbosity:minimal" "/p:Configuration=Release" }
83+
84+
If ($postBuild) {
85+
Write-Host -ForegroundColor "Green" "Run post build script..."
86+
Run-Command { & ($postBuild) }
87+
}
7288

73-
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Pack -Build -Symbols "$(Join-Path $projectPath "LibGit2Sharp.csproj")" -Prop Configuration=Release }
89+
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Pack -Prop Configuration=Release }
7490
}
7591
finally {
7692
Pop-Location

nuget.package/LibGit2Sharp.nuspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<file src="..\README.md" target="App_Readme\LibGit2Sharp.README.md" />
1818
<file src="..\LICENSE.md" target="App_Readme\LibGit2Sharp.LICENSE.md" />
1919
<file src="..\CHANGES.md" target="App_Readme\LibGit2Sharp.CHANGES.md" />
20+
<file src="bin\$configuration$\$id$.pdb" target="lib\net40" />
2021
</files>
2122
</package>

0 commit comments

Comments
 (0)