Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'eng/common/post-build/dotnetsymbol-init.ps1')
-rw-r--r--eng/common/post-build/dotnetsymbol-init.ps129
1 files changed, 29 insertions, 0 deletions
diff --git a/eng/common/post-build/dotnetsymbol-init.ps1 b/eng/common/post-build/dotnetsymbol-init.ps1
new file mode 100644
index 00000000000..e7659b98c8c
--- /dev/null
+++ b/eng/common/post-build/dotnetsymbol-init.ps1
@@ -0,0 +1,29 @@
+param (
+ $dotnetsymbolVersion = $null
+)
+
+$ErrorActionPreference = "Stop"
+Set-StrictMode -Version 2.0
+
+. $PSScriptRoot\..\tools.ps1
+
+$verbosity = "minimal"
+
+function Installdotnetsymbol ($dotnetsymbolVersion) {
+ $dotnetsymbolPackageName = "dotnet-symbol"
+
+ $dotnetRoot = InitializeDotNetCli -install:$true
+ $dotnet = "$dotnetRoot\dotnet.exe"
+ $toolList = & "$dotnet" tool list --global
+
+ if (($toolList -like "*$dotnetsymbolPackageName*") -and ($toolList -like "*$dotnetsymbolVersion*")) {
+ Write-Host "dotnet-symbol version $dotnetsymbolVersion is already installed."
+ }
+ else {
+ Write-Host "Installing dotnet-symbol version $dotnetsymbolVersion..."
+ Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
+ & "$dotnet" tool install $dotnetsymbolPackageName --version $dotnetsymbolVersion --verbosity $verbosity --global
+ }
+}
+
+Installdotnetsymbol $dotnetsymbolVersion