-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #684 from microsoft/libtemplateUpdate
Merge latest Library.Template
- Loading branch information
Showing
43 changed files
with
681 additions
and
259 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# Support | ||
|
||
## How to file issues and get help | ||
|
||
This project uses GitHub Issues to track bugs and feature requests. Please search the existing | ||
issues before filing new issues to avoid duplicates. For new issues, file your bug or | ||
feature request as a new Issue. | ||
|
||
For help and questions about using this project, please file a GitHub issue. | ||
|
||
## Microsoft Support Policy | ||
|
||
Support for this C# projection generator is limited to the resources listed above. | ||
# Support | ||
|
||
## How to file issues and get help | ||
|
||
This project uses GitHub Issues to track bugs and feature requests. Please search the existing | ||
issues before filing new issues to avoid duplicates. For new issues, file your bug or | ||
feature request as a new Issue. | ||
|
||
For help and questions about using this project, please file a GitHub issue. | ||
|
||
## Microsoft Support Policy | ||
|
||
Support for this C# projection generator is limited to the resources listed above. |
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,42 @@ | ||
<# | ||
.SYNOPSIS | ||
Converts between Windows PDB and Portable PDB formats. | ||
.PARAMETER DllPath | ||
The path to the DLL whose PDB is to be converted. | ||
.PARAMETER PdbPath | ||
The path to the PDB to convert. May be omitted if the DLL was compiled on this machine and the PDB is still at its original path. | ||
.PARAMETER OutputPath | ||
The path of the output PDB to write. | ||
#> | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory=$true,Position=0)] | ||
[string]$DllPath, | ||
[Parameter()] | ||
[string]$PdbPath, | ||
[Parameter(Mandatory=$true,Position=1)] | ||
[string]$OutputPath | ||
) | ||
|
||
if ($IsMacOS -or $IsLinux) { | ||
Write-Error "This script only works on Windows" | ||
return | ||
} | ||
|
||
$version = '1.1.0-beta2-21101-01' | ||
$baseDir = "$PSScriptRoot/../obj/tools" | ||
$pdb2pdbpath = "$baseDir/Microsoft.DiaSymReader.Pdb2Pdb.$version/tools/Pdb2Pdb.exe" | ||
if (-not (Test-Path $pdb2pdbpath)) { | ||
if (-not (Test-Path $baseDir)) { New-Item -Type Directory -Path $baseDir | Out-Null } | ||
$baseDir = (Resolve-Path $baseDir).Path # Normalize it | ||
Write-Verbose "& (& $PSScriptRoot/Get-NuGetTool.ps1) install Microsoft.DiaSymReader.Pdb2Pdb -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -Source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json | Out-Null" | ||
& (& $PSScriptRoot/Get-NuGetTool.ps1) install Microsoft.DiaSymReader.Pdb2Pdb -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -Source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json | Out-Null | ||
} | ||
|
||
$args = $DllPath,'/out',$OutputPath,'/nowarn','0021' | ||
if ($PdbPath) { | ||
$args += '/pdb',$PdbPath | ||
} | ||
|
||
Write-Verbose "$pdb2pdbpath $args" | ||
& $pdb2pdbpath $args |
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,86 @@ | ||
<# | ||
.SYNOPSIS | ||
Downloads the CodeCov.io uploader tool and returns the path to it. | ||
.PARAMETER AllowSkipVerify | ||
Allows skipping signature verification of the downloaded tool if gpg is not installed. | ||
#> | ||
[CmdletBinding()] | ||
Param( | ||
[switch]$AllowSkipVerify | ||
) | ||
|
||
if ($IsMacOS) { | ||
$codeCovUrl = "https://uploader.codecov.io/latest/macos/codecov" | ||
$toolName = 'codecov' | ||
} | ||
elseif ($IsLinux) { | ||
$codeCovUrl = "https://uploader.codecov.io/latest/linux/codecov" | ||
$toolName = 'codecov' | ||
} | ||
else { | ||
$codeCovUrl = "https://uploader.codecov.io/latest/windows/codecov.exe" | ||
$toolName = 'codecov.exe' | ||
} | ||
|
||
$shaSuffix = ".SHA256SUM" | ||
$sigSuffix = $shaSuffix + ".sig" | ||
|
||
Function Get-FileFromWeb([Uri]$Uri, $OutDir) { | ||
$OutFile = Join-Path $OutDir $Uri.Segments[-1] | ||
if (!(Test-Path $OutFile)) { | ||
Write-Verbose "Downloading $Uri..." | ||
if (!(Test-Path $OutDir)) { New-Item -ItemType Directory -Path $OutDir | Out-Null } | ||
try { | ||
(New-Object System.Net.WebClient).DownloadFile($Uri, $OutFile) | ||
} finally { | ||
# This try/finally causes the script to abort | ||
} | ||
} | ||
|
||
$OutFile | ||
} | ||
|
||
$toolsPath = & "$PSScriptRoot\Get-TempToolsPath.ps1" | ||
$binaryToolsPath = Join-Path $toolsPath codecov | ||
$testingPath = Join-Path $binaryToolsPath unverified | ||
$finalToolPath = Join-Path $binaryToolsPath $toolName | ||
|
||
if (!(Test-Path $finalToolPath)) { | ||
if (Test-Path $testingPath) { | ||
Remove-Item -Recurse -Force $testingPath # ensure we download all matching files | ||
} | ||
$tool = Get-FileFromWeb $codeCovUrl $testingPath | ||
$sha = Get-FileFromWeb "$codeCovUrl$shaSuffix" $testingPath | ||
$sig = Get-FileFromWeb "$codeCovUrl$sigSuffix" $testingPath | ||
$key = Get-FileFromWeb https://keybase.io/codecovsecurity/pgp_keys.asc $testingPath | ||
|
||
if ((Get-Command gpg -ErrorAction SilentlyContinue)) { | ||
Write-Host "Importing codecov key" -ForegroundColor Yellow | ||
gpg --import $key | ||
Write-Host "Verifying signature on codecov hash" -ForegroundColor Yellow | ||
gpg --verify $sig $sha | ||
} else { | ||
if ($AllowSkipVerify) { | ||
Write-Warning "gpg not found. Unable to verify hash signature." | ||
} else { | ||
throw "gpg not found. Unable to verify hash signature. Install gpg or add -AllowSkipVerify to override." | ||
} | ||
} | ||
|
||
Write-Host "Verifying hash on downloaded tool" -ForegroundColor Yellow | ||
$actualHash = (Get-FileHash -Path $tool -Algorithm SHA256).Hash | ||
$expectedHash = (Get-Content $sha).Split()[0] | ||
if ($actualHash -ne $expectedHash) { | ||
# Validation failed. Delete the tool so we can't execute it. | ||
#Remove-Item $codeCovPath | ||
throw "codecov uploader tool failed signature validation." | ||
} | ||
|
||
Copy-Item $tool $finalToolPath | ||
|
||
if ($IsMacOS -or $IsLinux) { | ||
chmod u+x $finalToolPath | ||
} | ||
} | ||
|
||
return $finalToolPath |
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,46 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
<# | ||
.SYNOPSIS | ||
Merges code coverage reports. | ||
.PARAMETER Path | ||
The path(s) to search for Cobertura code coverage reports. | ||
.PARAMETER Format | ||
The format for the merged result. The default is Cobertura | ||
.PARAMETER OutputDir | ||
The directory the merged result will be written to. The default is `coveragereport` in the root of this repo. | ||
#> | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory=$true)] | ||
[string[]]$Path, | ||
[ValidateSet('Badges', 'Clover', 'Cobertura', 'CsvSummary', 'Html', 'Html_Dark', 'Html_Light', 'HtmlChart', 'HtmlInline', 'HtmlInline_AzurePipelines', 'HtmlInline_AzurePipelines_Dark', 'HtmlInline_AzurePipelines_Light', 'HtmlSummary', 'JsonSummary', 'Latex', 'LatexSummary', 'lcov', 'MarkdownSummary', 'MHtml', 'PngChart', 'SonarQube', 'TeamCitySummary', 'TextSummary', 'Xml', 'XmlSummary')] | ||
[string]$Format='Cobertura', | ||
[string]$OutputDir=("$PSScriptRoot/../coveragereport") | ||
) | ||
|
||
$RepoRoot = [string](Resolve-Path $PSScriptRoot/..) | ||
|
||
if (!(Test-Path $RepoRoot/obj/reportgenerator*)) { | ||
dotnet tool install --tool-path $RepoRoot/obj dotnet-reportgenerator-globaltool --version 5.1.9 --configfile $PSScriptRoot/justnugetorg.nuget.config | ||
} | ||
|
||
Write-Verbose "Searching $Path for *.cobertura.xml files" | ||
$reports = Get-ChildItem -Recurse $Path -Filter *.cobertura.xml | ||
|
||
if ($reports) { | ||
$reports |% { $_.FullName } |% { | ||
# In addition to replacing {reporoot}, we also normalize on one kind of slash so that the report aggregates data for a file whether data was collected on Windows or not. | ||
$xml = [xml](Get-Content -Path $_) | ||
$xml.coverage.packages.package.classes.class |? { $_.filename} |% { | ||
$_.filename = $_.filename.Replace('{reporoot}', $RepoRoot).Replace([IO.Path]::AltDirectorySeparatorChar, [IO.Path]::DirectorySeparatorChar) | ||
} | ||
|
||
$xml.Save($_) | ||
} | ||
|
||
$Inputs = [string]::join(';', ($reports |% { Resolve-Path -relative $_.FullName })) | ||
& "$RepoRoot/obj/reportgenerator" -reports:"$Inputs" -targetdir:$OutputDir -reporttypes:$Format | ||
} else { | ||
Write-Error "No reports found to merge." | ||
} |
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,10 @@ | ||
<PoliCheckExclusions> | ||
<!--Each of these exclusions is a folder name -if \[name]\exists in the file path, it will be skipped --> | ||
<Exclusion Type="FolderPathFull">NODE_MODULES|.STORE</Exclusion> | ||
<!--Each of these exclusions is a folder name -if any folder or file starts with "\[name]", it will be skipped --> | ||
<!-- <Exclusion Type="FolderPathStart">ABC|XYZ</Exclusion>--> | ||
<!--Each of these file types will be completely skipped for the entire scan --> | ||
<!-- <Exclusion Type="FileType">.ABC|.XYZ</Exclusion>--> | ||
<!--The specified file names will be skipped during the scan regardless which folder they are in --> | ||
<!-- <Exclusion Type="FileName">ABC.TXT|XYZ.CS</Exclusion>--> | ||
</PoliCheckExclusions> |
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,37 @@ | ||
Param( | ||
[string]$Path | ||
) | ||
|
||
$ArtifactStagingFolder = & "$PSScriptRoot/Get-ArtifactsStagingDirectory.ps1" | ||
$ArtifactStagingFolder += '/symbols-legacy' | ||
robocopy $Path $ArtifactStagingFolder /mir /njh /njs /ndl /nfl | ||
$WindowsPdbSubDirName = 'symstore' | ||
|
||
Get-ChildItem "$ArtifactStagingFolder\*.pdb" -Recurse |% { | ||
$dllPath = "$($_.Directory)/$($_.BaseName).dll" | ||
$exePath = "$($_.Directory)/$($_.BaseName).exe" | ||
if (Test-Path $dllPath) { | ||
$BinaryImagePath = $dllPath | ||
} elseif (Test-Path $exePath) { | ||
$BinaryImagePath = $exePath | ||
} else { | ||
Write-Warning "`"$_`" found with no matching binary file." | ||
$BinaryImagePath = $null | ||
} | ||
|
||
if ($BinaryImagePath) { | ||
# Convert the PDB to legacy Windows PDBs | ||
Write-Host "Converting PDB for $_" -ForegroundColor DarkGray | ||
$WindowsPdbDir = "$($_.Directory.FullName)\$WindowsPdbSubDirName" | ||
if (!(Test-Path $WindowsPdbDir)) { mkdir $WindowsPdbDir | Out-Null } | ||
$legacyPdbPath = "$WindowsPdbDir\$($_.BaseName).pdb" | ||
& "$PSScriptRoot\Convert-PDB.ps1" -DllPath $BinaryImagePath -PdbPath $_ -OutputPath $legacyPdbPath | ||
if ($LASTEXITCODE -ne 0) { | ||
Write-Warning "PDB conversion of `"$_`" failed." | ||
} | ||
|
||
Move-Item $legacyPdbPath $_ -Force | ||
} | ||
} | ||
|
||
Write-Host "##vso[artifact.upload containerfolder=symbols-legacy;artifactname=symbols-legacy;]$ArtifactStagingFolder" |
Oops, something went wrong.