-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes two changes: 1. Move us to GitLink 3.0 1. Add source link info to all binaries we sign
- Loading branch information
Showing
7 changed files
with
87 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Collection of powershell build utility functions that we use across our scripts. | ||
|
||
Set-StrictMode -version 2.0 | ||
$ErrorActionPreference="Stop" | ||
|
||
# Declare a number of useful variables for other scripts to use | ||
[string]$repoDir = Resolve-Path (Join-Path $PSScriptRoot "..\..") | ||
[string]$binariesDir = Join-Path $repoDir "Binaries" | ||
[string]$scriptDir = $PSScriptRoot | ||
|
||
function Create-Directory([string]$dir) { | ||
New-Item $dir -ItemType Directory -ErrorAction SilentlyContinue | out-null | ||
} | ||
|
||
# Return the version of the NuGet package as used in this repo | ||
function Get-PackageVersion([string]$name) { | ||
$deps = Join-Path $repoDir "build\Targets\Dependencies.props" | ||
$nodeName = "$($name)Version" | ||
$x = [xml](Get-Content -raw $deps) | ||
$node = $x.Project.PropertyGroup[$nodeName] | ||
if ($node -eq $null) { | ||
throw "Cannot find package $name in Dependencies.props" | ||
} | ||
|
||
return $node.InnerText | ||
} | ||
|
||
# Locate the directory where our NuGet packages will be deployed. Needs to be kept in sync | ||
# with the logic in Version.props | ||
function Get-PackagesDir { | ||
$d = $null | ||
if ($env:NUGET_PACKAGES -ne $null) { | ||
$d = $env:NUGET_PACKAGES | ||
} | ||
else { | ||
$d = Join-Path $env:UserProfile ".nuget\packages\" | ||
} | ||
|
||
Create-Directory $d | ||
return $d | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Run GitLink on the binaries that we are producing. | ||
|
||
param([string]$config = "Release") | ||
Set-StrictMode -version 2.0 | ||
$ErrorActionPreference="Stop" | ||
|
||
try { | ||
. (Join-Path $PSScriptRoot "..\..\..\build\scripts\build-utils.ps1") | ||
|
||
$configDir = Join-Path $binariesDir $config | ||
$gitlinkVersion = Get-PackageVersion "GitLink" | ||
$gitlink = Join-Path (Get-PackagesDir) "GitLink\$gitlinkVersion\build\GitLink.exe" | ||
|
||
Write-Host "Running GitLink" | ||
|
||
$config = Join-Path $repoDir "build\config\SignToolData.json" | ||
$j = ConvertFrom-Json (Get-Content -raw $config) | ||
foreach ($entry in $j.sign) { | ||
foreach ($v in $entry.values) { | ||
$ext = [IO.Path]::GetExtension($v) | ||
if (($ext -eq ".dll") -or ($ext -eq ".exe")) { | ||
$name = [IO.Path]::ChangeExtension($v, ".pdb") | ||
$pdbPath = Join-Path $configDir $name | ||
Write-Host "`t$pdbPath" | ||
|
||
$output = & $gitlink -u "https://github.com/dotnet/roslyn" $pdbPath | ||
if (-not $?) { | ||
Write-Host "Error!!!" | ||
Write-Host $output | ||
exit 1 | ||
} | ||
} | ||
} | ||
} | ||
|
||
exit 0 | ||
} | ||
catch [exception] { | ||
write-host $_.Exception | ||
exit 1 | ||
} |