Skip to content

source index using SourceLink.exe #1009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ install:
$ShouldPublishNugetArtifact = "$($env:APPVEYOR_PULL_REQUEST_NUMBER -eq $null)"
$Env:SHOULD_PUBLISH_NUGET_ARTIFACT = $ShouldPublishNugetArtifact
Write-Host "Should publish Nuget artifact = $($Env:SHOULD_PUBLISH_NUGET_ARTIFACT)"
cinst sourcelink -y

assembly_info:
patch: true
Expand All @@ -62,7 +63,7 @@ test_script:

on_success:
- ps: |
& "$env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" "$env:APPVEYOR_REPO_COMMIT"
& "$env:APPVEYOR_BUILD_FOLDER\nuget.package\BuildNugetPackage.ps1" -commitSha "$env:APPVEYOR_REPO_COMMIT" -postBuild { sourcelink index -pr LibGit2Sharp.csproj -pp Configuration Release -nf Core\UniqueIdentifier.cs -nf Properties\AssemblyInfo.cs -r .. -u 'https://raw.githubusercontent.com/libgit2/libgit2sharp/{0}/%var2%' }
Add-Type -Path "$env:APPVEYOR_BUILD_FOLDER\LibGit2Sharp\bin\Release\LibGit2Sharp.dll"
Write-Host "LibGit2Sharp version = $([LibGit2Sharp.GlobalSettings]::Version)" -ForegroundColor "Magenta"
If ($Env:SHOULD_PUBLISH_NUGET_ARTIFACT -eq $True)
Expand Down
24 changes: 19 additions & 5 deletions nuget.package/BuildNugetPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

Param(
[Parameter(Mandatory=$true)]
[string]$commitSha
[string]$commitSha,
[scriptblock]$postBuild
)

$ErrorActionPreference = "Stop"
Expand Down Expand Up @@ -51,10 +52,19 @@ function Clean-OutputFolder($folder) {
}
}

# From http://www.dougfinke.com/blog/index.php/2010/12/01/note-to-self-how-to-programmatically-get-the-msbuild-path-in-powershell/

Function Get-MSBuild {
$lib = [System.Runtime.InteropServices.RuntimeEnvironment]
$rtd = $lib::GetRuntimeDirectory()
Join-Path $rtd msbuild.exe
}

#################

$root = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$projectPath = Join-Path $root "..\LibGit2Sharp"
$slnPath = Join-Path $projectPath "..\LibGit2Sharp.sln"

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

Expand All @@ -68,11 +78,15 @@ Push-Location $projectPath

try {
Set-Content -Encoding ASCII $(Join-Path $projectPath "libgit2sharp_hash.txt") $commitSha
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Restore "$(Join-Path $projectPath "..\LibGit2Sharp.sln")" }
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Restore "$slnPath" }
Run-Command { & (Get-MSBuild) "$slnPath" "/verbosity:minimal" "/p:Configuration=Release" }

If ($postBuild) {
Write-Host -ForegroundColor "Green" "Run post build script..."
Run-Command { & ($postBuild) }
}

# Cf. https://stackoverflow.com/questions/21728450/nuget-exclude-files-from-symbols-package-in-nuspec
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Pack -Build -Symbols "$(Join-Path $projectPath "LibGit2Sharp.csproj")" -Prop Configuration=Release -Exclude "**/NativeBinaries/**/*.*"}
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Pack "$(Join-Path $projectPath "LibGit2Sharp.csproj")" -Prop Configuration=Release }
Run-Command { & "$(Join-Path $projectPath "..\Lib\NuGet\Nuget.exe")" Pack -Prop Configuration=Release }
}
finally {
Pop-Location
Expand Down
1 change: 1 addition & 0 deletions nuget.package/LibGit2Sharp.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
<file src="..\CHANGES.md" target="App_Readme\LibGit2Sharp.CHANGES.md" />
<file src="..\nuget.package\build\*.*" target="build\net40" />
<file src="..\Lib\NativeBinaries\libgit2.license.txt" target="App_Readme" />
<file src="bin\$configuration$\$id$.pdb" target="lib\net40" />
</files>
</package>