Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/sourcelink
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.0-beta2-19324-01
Choose a base ref
...
head repository: dotnet/sourcelink
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.0.0-beta2-19351-01
Choose a head ref
  • 13 commits
  • 136 files changed
  • 2 contributors

Commits on Jun 24, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2991c9a View commit details
  2. Add darc (#296)

    tmat authored Jun 24, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    96065f2 View commit details

Commits on Jun 25, 2019

  1. Remove containers (#298)

    tmat authored Jun 25, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d8511c6 View commit details

Commits on Jun 26, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …624.24 (#297)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19324.24
    dotnet-maestro[bot] authored and tmat committed Jun 26, 2019
    Copy the full SHA
    2e2f74b View commit details
  2. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …626.2 (#300)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19326.2
    dotnet-maestro[bot] authored Jun 26, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5287c59 View commit details

Commits on Jun 27, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a048fc2 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5f6615b View commit details
  3. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …626.44 (#305)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19326.44
    dotnet-maestro[bot] authored Jun 27, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    df569cb View commit details

Commits on Jun 28, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …627.39 (#307)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19327.39
    dotnet-maestro[bot] authored Jun 28, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a975b6d View commit details

Commits on Jun 29, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …628.2 (#308)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19328.2
    dotnet-maestro[bot] authored Jun 29, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7d1f320 View commit details

Commits on Jun 30, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …629.2 (#309)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19329.2
    dotnet-maestro[bot] authored Jun 30, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6fa210f View commit details

Commits on Jul 1, 2019

  1. Update dependencies from https://github.com/dotnet/arcade build 20190…

    …630.1 (#310)
    
    - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19330.1
    dotnet-maestro[bot] authored Jul 1, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    229d459 View commit details
  2. Trim trailing whitespace in .git file (#312)

    * Trim trailing whitespace in .git file
    
    * Fix strings
    tmat authored Jul 1, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    51310e6 View commit details
Showing with 7,917 additions and 681 deletions.
  1. +8 −8 README.md
  2. +6 −29 azure-pipelines.yml
  3. +11 −0 eng/Version.Details.xml
  4. +1 −5 eng/Versions.props
  5. +158 −0 eng/common/CheckSymbols.ps1
  6. +11 −0 eng/common/PSScriptAnalyzerSettings.psd1
  7. +83 −0 eng/common/PublishToPackageFeed.proj
  8. +82 −0 eng/common/PublishToSymbolServers.proj
  9. +28 −0 eng/common/README.md
  10. +184 −0 eng/common/SourceLinkValidation.ps1
  11. +26 −19 eng/common/build.ps1
  12. +50 −57 eng/common/build.sh
  13. +41 −0 eng/common/cross/android/arm/toolchain.cmake
  14. +42 −0 eng/common/cross/android/arm64/toolchain.cmake
  15. +11 −0 eng/common/cross/arm/sources.list.bionic
  16. +3 −0 eng/common/cross/arm/sources.list.jessie
  17. +11 −0 eng/common/cross/arm/sources.list.trusty
  18. +11 −0 eng/common/cross/arm/sources.list.xenial
  19. +11 −0 eng/common/cross/arm/sources.list.zesty
  20. +71 −0 eng/common/cross/arm/trusty-lttng-2.4.patch
  21. +97 −0 eng/common/cross/arm/trusty.patch
  22. +11 −0 eng/common/cross/arm64/sources.list.bionic
  23. +11 −0 eng/common/cross/arm64/sources.list.buster
  24. +12 −0 eng/common/cross/arm64/sources.list.stretch
  25. +11 −0 eng/common/cross/arm64/sources.list.trusty
  26. +11 −0 eng/common/cross/arm64/sources.list.xenial
  27. +11 −0 eng/common/cross/arm64/sources.list.zesty
  28. +3 −0 eng/common/cross/armel/sources.list.jessie
  29. +44 −0 eng/common/cross/armel/tizen-build-rootfs.sh
  30. +171 −0 eng/common/cross/armel/tizen-fetch.sh
  31. +50 −0 eng/common/cross/armel/tizen/tizen-dotnet.ks
  32. +18 −0 eng/common/cross/armel/tizen/tizen.patch
  33. +137 −0 eng/common/cross/build-android-rootfs.sh
  34. +234 −0 eng/common/cross/build-rootfs.sh
  35. +138 −0 eng/common/cross/toolchain.cmake
  36. +11 −0 eng/common/cross/x86/sources.list.bionic
  37. +11 −0 eng/common/cross/x86/sources.list.trusty
  38. +11 −0 eng/common/cross/x86/sources.list.xenial
  39. +33 −0 eng/common/darc-init.ps1
  40. +64 −0 eng/common/darc-init.sh
  41. +0 −9 eng/common/docker/alpine.3.6/Dockerfile
  42. +0 −6 eng/common/docker/centos.6/Dockerfile
  43. +0 −6 eng/common/docker/debian.8.2/Dockerfile
  44. +0 −6 eng/common/docker/fedora.29/Dockerfile
  45. +0 −24 eng/common/docker/opensuse.42.3/Dockerfile
  46. +0 −6 eng/common/docker/rhel.7/Dockerfile
  47. +0 −27 eng/common/docker/ubuntu.14.04/Dockerfile
  48. +0 −13 eng/common/docker/ubuntu.18.04/Dockerfile
  49. +2 −0 eng/common/dotnet-install.cmd
  50. +27 −0 eng/common/dotnet-install.ps1
  51. +49 −0 eng/common/dotnet-install.sh
  52. +87 −0 eng/common/generate-graph-files.ps1
  53. +26 −0 eng/common/helixpublish.proj
  54. +3 −0 eng/common/init-tools-native.cmd
  55. +141 −0 eng/common/init-tools-native.ps1
  56. +141 −0 eng/common/init-tools-native.sh
  57. +135 −0 eng/common/internal-feed-operations.ps1
  58. +142 −0 eng/common/internal-feed-operations.sh
  59. +4 −0 eng/common/internal/Directory.Build.props
  60. +27 −0 eng/common/internal/Tools.csproj
  61. +27 −0 eng/common/msbuild.ps1
  62. +58 −0 eng/common/msbuild.sh
  63. +358 −0 eng/common/native/CommonLibrary.psm1
  64. +168 −0 eng/common/native/common-library.sh
  65. +117 −0 eng/common/native/install-cmake.sh
  66. +130 −0 eng/common/native/install-tool.ps1
  67. +233 −0 eng/common/pipeline-logging-functions.ps1
  68. +102 −0 eng/common/pipeline-logging-functions.sh
  69. +29 −0 eng/common/post-build/dotnetsymbol-init.ps1
  70. +28 −0 eng/common/post-build/nuget-validation.ps1
  71. +53 −0 eng/common/post-build/promote-build.ps1
  72. +29 −0 eng/common/post-build/sourcelink-cli-init.ps1
  73. +224 −0 eng/common/post-build/sourcelink-validation.ps1
  74. +186 −0 eng/common/post-build/symbols-validation.ps1
  75. +69 −0 eng/common/post-build/trigger-subscriptions.ps1
  76. +79 −0 eng/common/sdk-task.ps1
  77. +13 −0 eng/common/sdl/NuGet.config
  78. +97 −0 eng/common/sdl/execute-all-sdl-tools.ps1
  79. +70 −0 eng/common/sdl/extract-artifact-packages.ps1
  80. +48 −0 eng/common/sdl/init-sdl.ps1
  81. +4 −0 eng/common/sdl/packages.config
  82. +51 −0 eng/common/sdl/push-gdn.ps1
  83. +65 −0 eng/common/sdl/run-sdl.ps1
  84. +54 −0 eng/common/templates/job/execute-sdl.yml
  85. +48 −0 eng/common/templates/job/generate-graph-files.yml
  86. +205 −0 eng/common/templates/job/job.yml
  87. +84 −0 eng/common/templates/job/publish-build-assets.yml
  88. +90 −0 eng/common/templates/jobs/jobs.yml
  89. +130 −0 eng/common/templates/phases/base.yml
  90. +51 −0 eng/common/templates/phases/publish-build-assets.yml
  91. +170 −0 eng/common/templates/post-build/channels/internal-servicing.yml
  92. +166 −0 eng/common/templates/post-build/channels/public-dev-release.yml
  93. +170 −0 eng/common/templates/post-build/channels/public-release.yml
  94. +119 −0 eng/common/templates/post-build/channels/public-validation-release.yml
  95. +18 −0 eng/common/templates/post-build/common-variables.yml
  96. +91 −0 eng/common/templates/post-build/post-build.yml
  97. +24 −0 eng/common/templates/post-build/promote-build.yml
  98. +35 −0 eng/common/templates/post-build/setup-maestro-vars.yml
  99. +11 −0 eng/common/templates/post-build/trigger-subscription.yml
  100. +12 −0 eng/common/templates/steps/build-reason.yml
  101. +7 −0 eng/common/templates/steps/run-on-unix.yml
  102. +7 −0 eng/common/templates/steps/run-on-windows.yml
  103. +33 −0 eng/common/templates/steps/run-script-ifequalelse.yml
  104. +91 −0 eng/common/templates/steps/send-to-helix.yml
  105. +102 −0 eng/common/templates/steps/telemetry-end.yml
  106. +241 −0 eng/common/templates/steps/telemetry-start.yml
  107. +131 −52 eng/common/tools.ps1
  108. +110 −86 eng/common/tools.sh
  109. +2 −2 global.json
  110. +17 −2 src/Microsoft.Build.Tasks.Git.UnitTests/GitConfigTests.cs
  111. +4 −5 src/Microsoft.Build.Tasks.Git.UnitTests/GitDataTests.cs
  112. +65 −24 src/Microsoft.Build.Tasks.Git.UnitTests/GitOperationsTests.cs
  113. +14 −8 src/Microsoft.Build.Tasks.Git.UnitTests/GitRepositoryTests.cs
  114. +54 −16 src/Microsoft.Build.Tasks.Git/GitDataReader/GitConfig.Reader.cs
  115. +41 −10 src/Microsoft.Build.Tasks.Git/GitDataReader/GitEnvironment.cs
  116. +10 −7 src/Microsoft.Build.Tasks.Git/GitDataReader/GitRepository.cs
  117. +38 −5 src/Microsoft.Build.Tasks.Git/GitOperations.cs
  118. +2 −2 src/Microsoft.Build.Tasks.Git/LocateRepository.cs
  119. +23 −21 src/Microsoft.Build.Tasks.Git/RepositoryTask.cs
  120. +14 −8 src/Microsoft.Build.Tasks.Git/Resources.resx
  121. +25 −2 src/Microsoft.Build.Tasks.Git/build/Microsoft.Build.Tasks.Git.targets
  122. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.cs.xlf
  123. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.de.xlf
  124. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.es.xlf
  125. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.fr.xlf
  126. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.it.xlf
  127. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.ja.xlf
  128. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.ko.xlf
  129. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.pl.xlf
  130. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.pt-BR.xlf
  131. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.ru.xlf
  132. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.tr.xlf
  133. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.zh-Hans.xlf
  134. +26 −16 src/Microsoft.Build.Tasks.Git/xlf/Resources.zh-Hant.xlf
  135. +109 −7 src/SourceLink.Git.IntegrationTests/GitHubTests.cs
  136. +1 −1 src/TestUtilities/DotNetSdk/DotNetSdkTestBase.cs
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ For projects hosted by [GitHub](http://github.com) or [GitHub Enterprise](https:

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19270-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
</ItemGroup>
```

@@ -62,7 +62,7 @@ For projects hosted by [Azure DevOps](https://www.visualstudio.com/team-services

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta2-19270-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
</ItemGroup>
```

@@ -73,7 +73,7 @@ For projects hosted by on-prem [Team Foundation Server](https://visualstudio.mic

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Tfs.Git" Version="1.0.0-beta2-19270-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.Tfs.Git" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
<SourceLinkTfsGitHost Include="tfs-server-name" VirtualDirectory="tfs"/>
</ItemGroup>
```
@@ -86,7 +86,7 @@ For projects hosted by [GitLab](https://gitlab.com) reference [Microsoft.SourceL

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0-beta2-19270-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitLab" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
</ItemGroup>
```

@@ -96,7 +96,7 @@ For projects in git repositories hosted on [Bitbucket.org](https://bitbucket.org

```xml
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.Bitbucket.Git" Version="1.0.0-beta2-19270-01" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.Bitbucket.Git" Version="1.0.0-beta2-19324-01" PrivateAssets="All"/>
</ItemGroup>
```

@@ -123,9 +123,9 @@ To add Source Link support to your native project add package references corresp

```xml
<packages>
<package id="Microsoft.Build.Tasks.Git" version="1.0.0-beta2-19270-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.SourceLink.Common" version="1.0.0-beta2-19270-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.SourceLink.GitHub" version="1.0.0-beta2-19270-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.Build.Tasks.Git" version="1.0.0-beta2-19324-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.SourceLink.Common" version="1.0.0-beta2-19324-01" targetFramework="native" developmentDependency="true" />
<package id="Microsoft.SourceLink.GitHub" version="1.0.0-beta2-19324-01" targetFramework="native" developmentDependency="true" />
</packages>
```

35 changes: 6 additions & 29 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -70,55 +70,32 @@ jobs:
- job: Linux
strategy:
matrix:
Ubuntu18_Debug:
Debug:
_configuration: Debug
_container: ubuntu.18.04
Ubuntu18_Release:
Release:
_configuration: Release
_container: ubuntu.18.04
Ubuntu14:
_configuration: Debug
_container: ubuntu.14.04
Fedora:
_configuration: Debug
_container: fedora.29
RHEL:
_configuration: Debug
_container: rhel.7
CentOS:
_configuration: Debug
_container: centos.6
Alpine:
_configuration: Debug
_container: alpine.3.6
Debian:
_configuration: Debug
_container: debian.8.2
OpenSUSE:
_configuration: Debug
_container: opensuse.42.3

pool:
name: NetCorePublic-Pool
queue: buildpool.ubuntu.1604.amd64.open
queue: BuildPool.Ubuntu.1604.Amd64.Open
timeoutInMinutes: 20

steps:
- checkout: self
clean: true
- script: ./eng/cibuild.sh --configuration $(_configuration) --docker $(_container) --prepareMachine
- script: ./eng/cibuild.sh --configuration $(_configuration) --prepareMachine
displayName: Build and Test
- task: PublishTestResults@1
inputs:
testRunner: XUnit
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)/*.xml'
mergeTestResults: true
testRunTitle: $(_container) $(_configuration)'
testRunTitle: 'Ubuntu $(_configuration)'
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_configuration)'
ArtifactName: '$(_container) $(_configuration)'
ArtifactName: 'Ubuntu $(_configuration)'
continueOnError: true
condition: not(succeeded())
11 changes: 11 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19330.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>89fab80685c91024c8f9e21f1c37f62580f648f8</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
6 changes: 1 addition & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -5,14 +5,11 @@
<VersionPrefix>1.0.0</VersionPrefix>
<PreReleaseVersionLabel>beta2</PreReleaseVersionLabel>
<SemanticVersioningV1>true</SemanticVersioningV1>

<!-- Opt-in repo features -->
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
<!-- TODO: enable when we switch to snupkgs
<UsingToolSymbolUploader>true</UsingToolSymbolUploader> -->

<XUnitVersion>2.4.1</XUnitVersion>

<!--
MSBuild: Keep the version at 15.7 until we can target net472.
Newer packages cause netstandard2.0 dependencies to flow to SourceLink projects
@@ -21,7 +18,6 @@
-->
<MicrosoftBuildVersion>15.7.179</MicrosoftBuildVersion>
<MicrosoftBuildTasksCore>15.7.179</MicrosoftBuildTasksCore>

<!-- Libs -->
<LibGit2SharpVersion>0.26.0-preview-0070</LibGit2SharpVersion>
<MicrosoftTeamFoundationServerExtendedClientVersion>15.112.1</MicrosoftTeamFoundationServerExtendedClientVersion>
158 changes: 158 additions & 0 deletions eng/common/CheckSymbols.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][string] $SymbolToolPath # Full path to directory where dotnet symbol-tool was installed
)

Add-Type -AssemblyName System.IO.Compression.FileSystem

function FirstMatchingSymbolDescriptionOrDefault {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols
[string] $SymbolsPath
)

$FileName = [System.IO.Path]::GetFileName($FullPath)
$Extension = [System.IO.Path]::GetExtension($FullPath)

# Those below are potential symbol files that the `dotnet symbol` might
# return. Which one will be returned depend on the type of file we are
# checking and which type of file was uploaded.

# The file itself is returned
$SymbolPath = $SymbolsPath + "\" + $FileName

# PDB file for the module
$PdbPath = $SymbolPath.Replace($Extension, ".pdb")

# PDB file for R2R module (created by crossgen)
$NGenPdb = $SymbolPath.Replace($Extension, ".ni.pdb")

# DBG file for a .so library
$SODbg = $SymbolPath.Replace($Extension, ".so.dbg")

# DWARF file for a .dylib
$DylibDwarf = $SymbolPath.Replace($Extension, ".dylib.dwarf")

.\dotnet-symbol.exe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null

if (Test-Path $PdbPath) {
return "PDB"
}
elseif (Test-Path $NGenPdb) {
return "NGen PDB"
}
elseif (Test-Path $SODbg) {
return "DBG for SO"
}
elseif (Test-Path $DylibDwarf) {
return "Dwarf for Dylib"
}
elseif (Test-Path $SymbolPath) {
return "Module"
}
else {
return $null
}
}

function CountMissingSymbols {
param(
[string] $PackagePath # Path to a NuGet package
)

# Ensure input file exist
if (!(Test-Path $PackagePath)) {
throw "Input file does not exist: $PackagePath"
}

# Extensions for which we'll look for symbols
$RelevantExtensions = @(".dll", ".exe", ".so", ".dylib")

# How many files are missing symbol information
$MissingSymbols = 0

$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$PackageGuid = New-Guid
$ExtractPath = Join-Path -Path $ExtractPath -ChildPath $PackageGuid
$SymbolsPath = Join-Path -Path $ExtractPath -ChildPath "Symbols"

[System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath)

# Makes easier to reference `symbol tool`
Push-Location $SymbolToolPath

Get-ChildItem -Recurse $ExtractPath |
Where-Object {$RelevantExtensions -contains $_.Extension} |
ForEach-Object {
if ($_.FullName -Match "\\ref\\") {
Write-Host "`t Ignoring reference assembly file" $_.FullName
return
}

$SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--microsoft-symbol-server" $SymbolsPath
$SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--internal-server" $SymbolsPath

Write-Host -NoNewLine "`t Checking file" $_.FullName "... "

if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) {
Write-Host "Symbols found on MSDL (" $SymbolsOnMSDL ") and SymWeb (" $SymbolsOnSymWeb ")"
}
else {
$MissingSymbols++

if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) {
Write-Host "No symbols found on MSDL or SymWeb!"
}
else {
if ($SymbolsOnMSDL -eq $null) {
Write-Host "No symbols found on MSDL!"
}
else {
Write-Host "No symbols found on SymWeb!"
}
}
}
}

Pop-Location

return $MissingSymbols
}

function CheckSymbolsAvailable {
if (Test-Path $ExtractPath) {
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
}

Get-ChildItem "$InputPath\*.nupkg" |
ForEach-Object {
$FileName = $_.Name

# These packages from Arcade-Services include some native libraries that
# our current symbol uploader can't handle. Below is a workaround until
# we get issue: https://github.com/dotnet/arcade/issues/2457 sorted.
if ($FileName -Match "Microsoft\.DotNet\.Darc\.") {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}
elseif ($FileName -Match "Microsoft\.DotNet\.Maestro\.Tasks\.") {
Write-Host "Ignoring Arcade-services file: $FileName"
Write-Host
return
}

Write-Host "Validating $FileName "
$Status = CountMissingSymbols "$InputPath\$FileName"

if ($Status -ne 0) {
Write-Error "Missing symbols for $Status modules in the package $FileName"
}

Write-Host
}
}

CheckSymbolsAvailable
11 changes: 11 additions & 0 deletions eng/common/PSScriptAnalyzerSettings.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@{
IncludeRules=@('PSAvoidUsingCmdletAliases',
'PSAvoidUsingWMICmdlet',
'PSAvoidUsingPositionalParameters',
'PSAvoidUsingInvokeExpression',
'PSUseDeclaredVarsMoreThanAssignments',
'PSUseCmdletCorrectly',
'PSStandardDSCFunctionsInResource',
'PSUseIdenticalMandatoryParametersForDSC',
'PSUseIdenticalParametersForDSC')
}
Loading