From 62ce305f06c502a2fae459fc906c982b943c6128 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 14 Feb 2018 11:50:14 -0800 Subject: [PATCH] Update to aspnetcore 2.1.0-preview1-28275 and react to feed layout changes (#8611) --- build/BundledRuntimes.props | 7 ++++--- build/DependencyVersions.props | 4 ++-- scripts/obtain/dotnet-install.ps1 | 32 +++++++++++++++++++++---------- scripts/obtain/dotnet-install.sh | 30 +++++++++++++++++++---------- 4 files changed, 48 insertions(+), 25 deletions(-) diff --git a/build/BundledRuntimes.props b/build/BundledRuntimes.props index 2ebe51f545..aeeaf373d9 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -49,6 +49,7 @@ $(CoreSetupBlobRootUrl)Runtime/ + $(CoreSetupBlobRootUrl)aspnetcore/Runtime/ $(IntermediateDirectory)/coreSetupDownload/$(MicrosoftNETCoreAppPackageVersion) $(CoreSetupDownloadDirectory)/combinedSharedHostAndFrameworkArchive$(ArchiveExtension) @@ -56,7 +57,7 @@ <_DownloadAndExtractItem Include="AspNetCoreSharedFxArchiveFile" Condition="!Exists('$(AspNetCoreSharedFxArchiveFile)')"> - $(CoreSetupRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxArchiveFileName)$(CoreSetupBlobAccessTokenParam) + $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxArchiveFileName)$(CoreSetupBlobAccessTokenParam) $(AspNetCoreSharedFxArchiveFile) $(AspNetCoreSharedFxPublishDirectory) @@ -98,14 +99,14 @@ <_DownloadAndExtractItem Include="DownloadedAspNetCoreSharedFxInstallerFile" Condition="'$(SkipBuildingInstallers)' != 'true' AND '$(DownloadedAspNetCoreSharedFxInstallerFile)' != '' AND !Exists($(DownloadedAspNetCoreSharedFxInstallerFile)) And '$(InstallerExtension)' != ''"> - $(CoreSetupRootUrl)$(AspNetCoreVersion)/$(DownloadedAspNetCoreSharedFxInstallerFileName)$(CoreSetupBlobAccessTokenParam) + $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(DownloadedAspNetCoreSharedFxInstallerFileName)$(CoreSetupBlobAccessTokenParam) $(DownloadedAspNetCoreSharedFxInstallerFile) <_DownloadAndExtractItem Include="AspNetCoreSharedFxBaseRuntimeVersionFile" Condition="!Exists('$(AspNetCoreSharedFxBaseRuntimeVersionFile)')"> - $(CoreSetupRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxBaseRuntimeVersionFileName)$(CoreSetupBlobAccessTokenParam) + $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxBaseRuntimeVersionFileName)$(CoreSetupBlobAccessTokenParam) $(AspNetCoreSharedFxBaseRuntimeVersionFile) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index 6961bdfdf6..6d5690141f 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -1,7 +1,7 @@ - 2.1.0-preview1-28263 + 2.1.0-preview1-28275 2.1.0-preview1-26116-04 $(MicrosoftNETCoreAppPackageVersion) 15.6.81 @@ -59,7 +59,7 @@ $(MicrosoftNETCoreAppPackageVersion) $(MicrosoftNETCoreAppPackageVersion) - $(MicrosoftAspNetCoreAllPackageVersion) + $(MicrosoftAspNetCoreAppPackageVersion) diff --git a/scripts/obtain/dotnet-install.ps1 b/scripts/obtain/dotnet-install.ps1 index 975b93d0dc..1a35ec4fba 100644 --- a/scripts/obtain/dotnet-install.ps1 +++ b/scripts/obtain/dotnet-install.ps1 @@ -43,8 +43,8 @@ .PARAMETER Runtime Installs just a shared runtime, not the entire SDK. Possible values: - - dotnet - - aspnetcore + - dotnet - the Microsoft.NETCore.App shared runtime + - aspnetcore - the Microsoft.AspNetCore.App shared runtime .PARAMETER DryRun If set it will not perform installation but instead display what command line to use to consistently install currently requested version of dotnet cli. In example if you specify version 'latest' it will display a link @@ -249,10 +249,10 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Co if ($Runtime -eq "dotnet") { $VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version" } - elseif ($Runtime) { - $VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.$Runtime.version" + elseif ($Runtime -eq "aspnetcore") { + $VersionFileUrl = "$UncachedFeed/aspnetcore/Runtime/$Channel/latest.version" } - else { + elseif (-not $Runtime) { if ($Coherent) { $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.coherent.version" } @@ -260,6 +260,9 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Co $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version" } } + else { + throw "Invalid value for `$Runtime" + } $Response = GetHTTPResponse -Uri $VersionFileUrl $StringContent = $Response.Content.ReadAsStringAsync().Result @@ -296,12 +299,18 @@ function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, function Get-Download-Link([string]$AzureFeed, [string]$SpecificVersion, [string]$CLIArchitecture) { Say-Invocation $MyInvocation - if ($Runtime) { - $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/$Runtime-runtime-$SpecificVersion-win-$CLIArchitecture.zip" + if ($Runtime -eq "dotnet") { + $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip" } - else { + elseif ($Runtime -eq "aspnetcore") { + $PayloadURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/aspnetcore-runtime-$SpecificVersion-win-$CLIArchitecture.zip" + } + elseif (-not $Runtime) { $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip" } + else { + throw "Invalid value for `$Runtime" + } Say-Verbose "Constructed primary payload URL: $PayloadURL" @@ -503,12 +512,15 @@ if ($Runtime -eq "dotnet") { } elseif ($Runtime -eq "aspnetcore") { $assetName = "ASP.NET Core Runtime" - $dotnetPackageRelativePath = "shared\Microsoft.AspNetCore.All" + $dotnetPackageRelativePath = "shared\Microsoft.AspNetCore.App" } -else { +elseif (-not $Runtime) { $assetName = ".NET Core SDK" $dotnetPackageRelativePath = "sdk" } +else { + throw "Invalid value for `$Runtime" +} $isAssetInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage $dotnetPackageRelativePath -SpecificVersion $SpecificVersion if ($isAssetInstalled) { diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh index 81a4de77e3..04b5a38203 100755 --- a/scripts/obtain/dotnet-install.sh +++ b/scripts/obtain/dotnet-install.sh @@ -390,14 +390,17 @@ get_latest_version_info() { local version_file_url=null if [[ "$runtime" == "dotnet" ]]; then version_file_url="$uncached_feed/Runtime/$channel/latest.version" - elif [ ! -z "$runtime" ]; then - version_file_url="$uncached_feed/Runtime/$channel/latest.$runtime.version" - else + elif [[ "$runtime" == "aspnetcore" ]]; then + version_file_url="$uncached_feed/aspnetcore/Runtime/$channel/latest.version" + elif [ -z "$runtime" ]; then if [ "$coherent" = true ]; then version_file_url="$uncached_feed/Sdk/$channel/latest.coherent.version" else version_file_url="$uncached_feed/Sdk/$channel/latest.version" fi + else + say_err "Invalid value for \$runtime" + return 1 fi say_verbose "get_latest_version_info: latest url: $version_file_url" @@ -457,10 +460,14 @@ construct_download_link() { osname="$(get_current_os_name)" || return 1 local download_link=null - if [ ! -z "$runtime" ]; then - download_link="$azure_feed/Runtime/$specific_version/$runtime-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" - else + if [[ "$runtime" == "dotnet" ]]; then + download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" + elif [[ "$runtime" == "aspnetcore" ]]; then + download_link="$azure_feed/aspnetcore/Runtime/$specific_version/aspnetcore-runtime-$specific_version-$osname-$normalized_architecture.tar.gz" + elif [ -z "$runtime" ]; then download_link="$azure_feed/Sdk/$specific_version/dotnet-sdk-$specific_version-$osname-$normalized_architecture.tar.gz" + else + return 1 fi echo "$download_link" @@ -706,11 +713,14 @@ install_dotnet() { asset_relative_path="shared/Microsoft.NETCore.App" asset_name=".NET Core Runtime" elif [[ "$runtime" == "aspnetcore" ]]; then - asset_relative_path="shared/Microsoft.AspNetCore.All" + asset_relative_path="shared/Microsoft.AspNetCore.App" asset_name="ASP.NET Core Runtime" - else + elif [ -z "$runtime" ]; then asset_relative_path="sdk" asset_name=".NET Core SDK" + else + say_err "Invalid value for \$runtime" + return 1 fi if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$specific_version"; then @@ -866,8 +876,8 @@ do echo " --runtime Installs a shared runtime only, without the SDK." echo " -Runtime" echo " Possible values:" - echo " - dotnet - the Microsoft.NETCore.App shared framework" - echo " - aspnetcore - the Microsoft.AspNetCore.All shared framework" + echo " - dotnet - the Microsoft.NETCore.App shared runtime" + echo " - aspnetcore - the Microsoft.AspNetCore.App shared runtime" echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable." echo " -SkipNonVersionedFiles" echo " --dry-run,-DryRun Do not perform installation. Display download link."