From 2a84c138177a4b8ca146c33b2995b90ee2ceb2a0 Mon Sep 17 00:00:00 2001 From: Krzysztof Wicher Date: Fri, 27 May 2016 12:19:53 -0700 Subject: [PATCH] add -SharedRuntime switch support --- scripts/obtain/dotnet-install.ps1 | 21 +++++++++++++++++++-- scripts/obtain/dotnet-install.sh | 21 +++++++++++++++++++-- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/scripts/obtain/dotnet-install.ps1 b/scripts/obtain/dotnet-install.ps1 index 5c4d86091..277bea6fc 100644 --- a/scripts/obtain/dotnet-install.ps1 +++ b/scripts/obtain/dotnet-install.ps1 @@ -29,6 +29,9 @@ Default: - this value represents currently running OS architecture Architecture of dotnet binaries to be installed. Possible values are: , x64 and x86 +.PARAMETER SharedRuntime + Default: false + Installs just the shared runtime bits, not the entire SDK .PARAMETER DebugSymbols If set the installer will include symbols in the installation. .PARAMETER DryRun @@ -51,6 +54,7 @@ param( [string]$Version="Latest", [string]$InstallDir="", [string]$Architecture="", + [switch]$SharedRuntime, [switch]$DebugSymbols, # TODO: Switch does not work yet. Symbols zip is not being uploaded yet. [switch]$DryRun, [switch]$NoPath, @@ -114,7 +118,14 @@ function Get-Version-Info-From-Version-Text([string]$VersionText) { function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [string]$CLIArchitecture) { Say-Invocation $MyInvocation - $VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.win.$CLIArchitecture.version" + $VersionFileUrl = $null + if ($SharedRuntime) { + $VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.sharedfx.win.$CLIArchitecture.version" + } + else { + $VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.win.$CLIArchitecture.version" + } + $Response = Invoke-WebRequest -UseBasicParsing $VersionFileUrl switch ($Response.Headers.'Content-Type'){ @@ -160,7 +171,13 @@ function Get-Download-Links([string]$AzureFeed, [string]$AzureChannel, [string]$ Say-Invocation $MyInvocation $ret = @() - $files = @("dotnet-dev") + $files = @() + if ($SharedRuntime) { + $files += "dotnet"; + } + else { + $files += "dotnet-dev"; + } foreach ($file in $files) { $PayloadURL = "$AzureFeed/$AzureChannel/Binaries/$SpecificVersion/$file-win-$CLIArchitecture.$SpecificVersion.zip" diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh index 614bced13..8d0fdde27 100755 --- a/scripts/obtain/dotnet-install.sh +++ b/scripts/obtain/dotnet-install.sh @@ -269,7 +269,12 @@ get_latest_version_info() { local osname=$(get_current_os_name) - local version_file_url="$azure_feed/$azure_channel/dnvm/latest.$osname.$normalized_architecture.version" + local version_file_url=null + if [ "$shared_runtime" = true ]; then + version_file_url="$azure_feed/$azure_channel/dnvm/latest.sharedfx.$osname.$normalized_architecture.version" + else + version_file_url="$azure_feed/$azure_channel/dnvm/latest.$osname.$normalized_architecture.version" + fi say_verbose "get_latest_version_info: latest url: $version_file_url" download $version_file_url @@ -350,7 +355,13 @@ construct_download_link() { local osname=$(get_current_os_name) - local download_link="$azure_feed/$azure_channel/Binaries/$specific_version/dotnet-dev-$osname-$normalized_architecture.$specific_version.tar.gz" + local download_link=null + if [ "$shared_runtime" = true ]; then + download_link="$azure_feed/$azure_channel/Binaries/$specific_version/dotnet-$osname-$normalized_architecture.$specific_version.tar.gz" + else + download_link="$azure_feed/$azure_channel/Binaries/$specific_version/dotnet-dev-$osname-$normalized_architecture.$specific_version.tar.gz" + fi + echo "$download_link" return 0 } @@ -540,6 +551,7 @@ dry_run=false no_path=false azure_feed="https://dotnetcli.blob.core.windows.net/dotnet" verbose=false +shared_runtime=false while [ $# -ne 0 ] do @@ -561,6 +573,9 @@ do shift architecture="$1" ;; + --shared-runtime|-[Ss]hared[Rr]untime) + shared_runtime=true + ;; --debug-symbols|-[Dd]ebug[Ss]ymbols) debug_symbols=true ;; @@ -594,6 +609,8 @@ do echo " -InstallDir" echo " --architecture Architecture of .NET Tools. Currently only x64 is supported." echo " --arch,-Architecture,-Arch" + echo " --shared-runtime Installs just the shared runtime bits, not the entire SDK." + echo " -SharedRuntime" echo " --debug-symbols,-DebugSymbols Specifies if symbols should be included in the installation." echo " --dry-run,-DryRun Do not perform installation. Display download link." echo " --no-path, -NoPath Do not set PATH for the current process."