Merge pull request #6925 from dotnet/merges/release/2.0.0-to-master-20170619-070044

Merge release/2.0.0 to master
This commit is contained in:
Livar 2017-06-19 15:00:22 -07:00 committed by GitHub
commit bd7bd69530
15 changed files with 132 additions and 42 deletions

View file

@ -59,6 +59,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4
build\Test.targets = build\Test.targets build\Test.targets = build\Test.targets
build\Version.props = build\Version.props build\Version.props = build\Version.props
build\VersionBadge.props = build\VersionBadge.props build\VersionBadge.props = build\VersionBadge.props
build\DerivedHostMachineInfo.props = build\DerivedHostMachineInfo.props
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{FD7D515A-D10F-4F49-B8AE-21CF7ED071AE}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{FD7D515A-D10F-4F49-B8AE-21CF7ED071AE}"

View file

@ -32,6 +32,8 @@
<PropertyGroup> <PropertyGroup>
<AspNetCoreRuntimeInstallerBlobRootUrl>$(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeVersion)</AspNetCoreRuntimeInstallerBlobRootUrl> <AspNetCoreRuntimeInstallerBlobRootUrl>$(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeVersion)</AspNetCoreRuntimeInstallerBlobRootUrl>
<AspNetCoreSharedRuntimeVersionFileName>runtime.version</AspNetCoreSharedRuntimeVersionFileName>
<AspNetCoreSharedRuntimeVersionFile Condition=" '$(AspNetCoreSharedRuntimeVersionFileName)' != '' ">$(PackagesDirectory)/$(AspNetCoreSharedRuntimeVersionFileName)</AspNetCoreSharedRuntimeVersionFile>
<!-- Examples: Build.RS.linux.zip Build.RS.winx86.zip AspNetCorePackageStoreLibx64.wixlib --> <!-- Examples: Build.RS.linux.zip Build.RS.winx86.zip AspNetCorePackageStoreLibx64.wixlib -->
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(HostOSName)' == 'win' ">$(HostOSName)$(Architecture)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken> <AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(HostOSName)' == 'win' ">$(HostOSName)$(Architecture)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
@ -90,5 +92,12 @@
<ExtractDestination>$(AspNetRuntimePackageStorePublishDirectory)</ExtractDestination> <ExtractDestination>$(AspNetRuntimePackageStorePublishDirectory)</ExtractDestination>
</_DownloadAndExtractItem> </_DownloadAndExtractItem>
<_DownloadAndExtractItem Include="AspNetCoreSharedRuntimeVersionFile"
Condition="!Exists('$(AspNetCoreSharedRuntimeVersionFile)')">
<Url>$(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreSharedRuntimeVersionFileName)</Url>
<DownloadFileName>$(AspNetCoreSharedRuntimeVersionFile)</DownloadFileName>
<ExtractDestination></ExtractDestination>
</_DownloadAndExtractItem>
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<CLI_SharedFrameworkVersion>2.0.0-preview2-25407-01</CLI_SharedFrameworkVersion> <CLI_SharedFrameworkVersion>2.0.0-preview3-25415-01</CLI_SharedFrameworkVersion>
<CLI_MSBuild_Version>15.3.0-preview-000388-01</CLI_MSBuild_Version> <CLI_MSBuild_Version>15.3.0-preview-000388-01</CLI_MSBuild_Version>
<CLI_Roslyn_Version>2.3.0-beta3-61814-09</CLI_Roslyn_Version> <CLI_Roslyn_Version>2.3.0-beta3-61814-09</CLI_Roslyn_Version>
<CLI_DiaSymNative_Version>1.6.0-beta2-25304</CLI_DiaSymNative_Version> <CLI_DiaSymNative_Version>1.6.0-beta2-25304</CLI_DiaSymNative_Version>
@ -10,7 +10,7 @@
<!-- We'll usually want to keep these versions in sync, but we may want to diverge in some <!-- We'll usually want to keep these versions in sync, but we may want to diverge in some
cases, so use separate properties but derive one from the other unless we want to cases, so use separate properties but derive one from the other unless we want to
explicitly use different versions. --> explicitly use different versions. -->
<CLI_NETSDK_Version>2.0.0-preview2-20170614-1</CLI_NETSDK_Version> <CLI_NETSDK_Version>2.0.0-preview2-20170615-7</CLI_NETSDK_Version>
<CLI_MSBuildExtensions_Version>$(CLI_NETSDK_Version)</CLI_MSBuildExtensions_Version> <CLI_MSBuildExtensions_Version>$(CLI_NETSDK_Version)</CLI_MSBuildExtensions_Version>
<CLI_NuGet_Version>4.3.0-preview3-4168</CLI_NuGet_Version> <CLI_NuGet_Version>4.3.0-preview3-4168</CLI_NuGet_Version>
@ -23,8 +23,8 @@
<TemplateEngineVersion>1.0.0-beta2-20170608-254</TemplateEngineVersion> <TemplateEngineVersion>1.0.0-beta2-20170608-254</TemplateEngineVersion>
<TemplateEngineTemplateVersion>1.0.0-beta2-20170612-258</TemplateEngineTemplateVersion> <TemplateEngineTemplateVersion>1.0.0-beta2-20170612-258</TemplateEngineTemplateVersion>
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170612-258</TemplateEngineTemplate2_0Version> <TemplateEngineTemplate2_0Version>1.0.0-beta2-20170612-258</TemplateEngineTemplate2_0Version>
<PlatformAbstractionsVersion>2.0.0-preview2-25407-01</PlatformAbstractionsVersion> <PlatformAbstractionsVersion>2.0.0-preview3-25415-01</PlatformAbstractionsVersion>
<DependencyModelVersion>2.0.0-preview2-25407-01</DependencyModelVersion> <DependencyModelVersion>2.0.0-preview3-25415-01</DependencyModelVersion>
<CliCommandLineParserVersion>0.1.0-alpha-142</CliCommandLineParserVersion> <CliCommandLineParserVersion>0.1.0-alpha-142</CliCommandLineParserVersion>
<CliMigrateVersion>1.2.1-alpha-002133</CliMigrateVersion> <CliMigrateVersion>1.2.1-alpha-002133</CliMigrateVersion>
<MicroBuildVersion>0.2.0</MicroBuildVersion> <MicroBuildVersion>0.2.0</MicroBuildVersion>

View file

@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<IsDebianBaseDistro Condition=" '$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian' ">true</IsDebianBaseDistro>
<IsRPMBasedDistro Condition=" $(HostRid.StartsWith('rhel')) ">true</IsRPMBasedDistro>
<IsLinuxDistroSpecific Condition=" ('$(IsDebianBaseDistro)' == 'true' OR '$(IsRPMBasedDistro)' == 'true') AND '$(IslinuxPortable)' != 'true' ">true</IsLinuxDistroSpecific>
</PropertyGroup>
</Project>

View file

@ -1,20 +1,17 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<IsDebianBaseDistro Condition=" '$(HostOSName)' == 'ubuntu' OR '$(HostOSName)' == 'debian' ">True</IsDebianBaseDistro>
<IsRPMBasedDistro Condition=" $(HostRid.StartsWith('rhel')) ">True</IsRPMBasedDistro>
<ArchiveExtension Condition=" '$(HostOSName)' == 'win' ">.zip</ArchiveExtension> <ArchiveExtension Condition=" '$(HostOSName)' == 'win' ">.zip</ArchiveExtension>
<ArchiveExtension Condition=" '$(HostOSName)' != 'win' ">.tar.gz</ArchiveExtension> <ArchiveExtension Condition=" '$(HostOSName)' != 'win' ">.tar.gz</ArchiveExtension>
<InstallerExtension Condition=" '$(HostOSName)' == 'win' ">.msi</InstallerExtension> <InstallerExtension Condition=" '$(HostOSName)' == 'win' ">.msi</InstallerExtension>
<InstallerExtension Condition=" '$(HostOSName)' == 'osx' ">.pkg</InstallerExtension> <InstallerExtension Condition=" '$(HostOSName)' == 'osx' ">.pkg</InstallerExtension>
<InstallerExtension Condition=" '$(IsDebianBaseDistro)' == 'True' ">.deb</InstallerExtension> <InstallerExtension Condition=" '$(IsDebianBaseDistro)' == 'true' ">.deb</InstallerExtension>
<InstallerExtension Condition=" '$(IsRPMBasedDistro)' == True ">.rpm</InstallerExtension> <InstallerExtension Condition=" '$(IsRPMBasedDistro)' == true ">.rpm</InstallerExtension>
<BundleExtension Condition=" '$(HostOSName)' == 'win' ">.exe</BundleExtension> <BundleExtension Condition=" '$(HostOSName)' == 'win' ">.exe</BundleExtension>
<BundleExtension Condition=" '$(HostOSName)' == 'osx' ">$(InstallerExtension)</BundleExtension> <BundleExtension Condition=" '$(HostOSName)' == 'osx' ">$(InstallerExtension)</BundleExtension>
<BundleExtension Condition=" '$(IsDebianBaseDistro)' == 'True' ">$(InstallerExtension)</BundleExtension> <BundleExtension Condition=" '$(IsDebianBaseDistro)' == 'true' ">$(InstallerExtension)</BundleExtension>
<BundleExtension Condition=" '$(IsRPMBasedDistro)' == True ">$(InstallerExtension)</BundleExtension> <BundleExtension Condition=" '$(IsRPMBasedDistro)' == true ">$(InstallerExtension)</BundleExtension>
<DynamicLibPrefix>lib</DynamicLibPrefix> <DynamicLibPrefix>lib</DynamicLibPrefix>
<DynamicLibPrefix Condition=" '$(HostOSName)' == 'win' "></DynamicLibPrefix> <DynamicLibPrefix Condition=" '$(HostOSName)' == 'win' "></DynamicLibPrefix>

View file

@ -26,9 +26,12 @@
<Target Name="GatherItemsForPattern"> <Target Name="GatherItemsForPattern">
<ItemGroup> <ItemGroup>
<ForPublishing Include="@(GeneratedInstallers)" /> <ForPublishing Include="@(GeneratedInstallers)"
<ForPublishing Include="%(GenerateArchivesInputsOutputs.Outputs)" /> Condition=" '$(IslinuxPortable)' != 'true' "/>
<ForPublishing Include="$(PackagesDirectory)/Microsoft*.nupkg" Condition=" '$(PUBLISH_NUPKG_TO_AZURE_BLOB)' != '' " /> <ForPublishing Include="%(GenerateArchivesInputsOutputs.Outputs)"
Condition=" '$(IsLinuxDistroSpecific)' != 'true' "/>
<ForPublishing Include="$(PackagesDirectory)/Microsoft*.nupkg"
Condition=" '$(PUBLISH_NUPKG_TO_AZURE_BLOB)' != '' AND '$(IsLinuxDistroSpecific)' != 'true'"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -99,6 +99,7 @@
<Target Name="TestSdkDeb" <Target Name="TestSdkDeb"
Condition=" '$(IsDebianBaseDistro)' == 'True' and '$(DebuildPresent)' == 'true' " Condition=" '$(IsDebianBaseDistro)' == 'True' and '$(DebuildPresent)' == 'true' "
DependsOnTargets="RestoreTests"
Inputs="$(DownloadedSharedHostInstallerFile); Inputs="$(DownloadedSharedHostInstallerFile);
$(DownloadedHostFxrInstallerFile); $(DownloadedHostFxrInstallerFile);
$(DownloadedSharedFrameworkInstallerFile); $(DownloadedSharedFrameworkInstallerFile);

View file

@ -182,6 +182,7 @@
</Target> </Target>
<Target Name="TestSdkRpm" <Target Name="TestSdkRpm"
DependsOnTargets="RestoreTests"
Condition=" '$(IsRPMBasedDistro)' == 'True' and '$(FPMPresent)' == 'True' " Condition=" '$(IsRPMBasedDistro)' == 'True' and '$(FPMPresent)' == 'True' "
Inputs="$(DownloadedSharedHostInstallerFile); Inputs="$(DownloadedSharedHostInstallerFile);
$(DownloadedHostFxrInstallerFile); $(DownloadedHostFxrInstallerFile);

View file

@ -2,6 +2,7 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="FinishBuild" <Target Name="FinishBuild"
DependsOnTargets="CheckIfAllBuildsHavePublished; DependsOnTargets="CheckIfAllBuildsHavePublished;
EvaluateRuntimeCoherence;
FinalizeBuild" /> FinalizeBuild" />
<Target Name="CheckIfAllBuildsHavePublished"> <Target Name="CheckIfAllBuildsHavePublished">
@ -14,6 +15,27 @@
</CheckIfAllBuildsHavePublished> </CheckIfAllBuildsHavePublished>
</Target> </Target>
<Target Name="EvaluateRuntimeCoherence"
DependsOnTargets="ReadAspNetCoreSharedRuntimeVersionFile"
BeforeTargets="FinalizeBuild">
<PropertyGroup>
<Coherent>false</Coherent>
<Coherent Condition=" '$(CLI_SharedFrameworkVersion)' == '@(AspNetCoreSharedRuntimeVersion)' ">true</Coherent>
</PropertyGroup>
</Target>
<Target Name="ReadAspNetCoreSharedRuntimeVersionFile"
DependsOnTargets="DownloadHostAndSharedFxArtifacts">
<ItemGroup>
<File Include="$(AspNetCoreSharedRuntimeVersionFile)" />
</ItemGroup>
<ReadLinesFromFile File="@(File)">
<Output
TaskParameter="Lines"
ItemName="AspNetCoreSharedRuntimeVersion"/>
</ReadLinesFromFile>
</Target>
<Target Name="FinalizeBuild" <Target Name="FinalizeBuild"
Condition=" '$(HaveAllBuildsPublished)' == 'True' "> Condition=" '$(HaveAllBuildsPublished)' == 'True' ">
<CopyBlobsToLatest AccountName="$(ArtifactCloudDropAccountName)" <CopyBlobsToLatest AccountName="$(ArtifactCloudDropAccountName)"
@ -21,14 +43,16 @@
ContainerName="$(ArtifactContainerName)" ContainerName="$(ArtifactContainerName)"
NugetVersion="$(FullNugetVersion)" NugetVersion="$(FullNugetVersion)"
Channel="$(Channel)" Channel="$(Channel)"
CommitHash="$(CommitHash)" /> CommitHash="$(CommitHash)"
Coherent="$(Coherent)" />
<CopyBlobsToLatest AccountName="$(ChecksumCloudDropAccountName)" <CopyBlobsToLatest AccountName="$(ChecksumCloudDropAccountName)"
AccountKey="$(ChecksumCloudDropAccessToken)" AccountKey="$(ChecksumCloudDropAccessToken)"
ContainerName="$(ChecksumContainerName)" ContainerName="$(ChecksumContainerName)"
NugetVersion="$(FullNugetVersion)" NugetVersion="$(FullNugetVersion)"
Channel="$(Channel)" Channel="$(Channel)"
CommitHash="$(CommitHash)" /> CommitHash="$(CommitHash)"
Coherent="$(Coherent)" />
<!-- Uncomment the line below when https://github.com/dotnet/buildtools/issues/1547 gets fixed. --> <!-- Uncomment the line below when https://github.com/dotnet/buildtools/issues/1547 gets fixed. -->
<!-- <UpdateVersionsRepo BranchName="$(BranchName)" <!-- <UpdateVersionsRepo BranchName="$(BranchName)"

View file

@ -31,6 +31,8 @@ namespace Microsoft.DotNet.Cli.Build
[Required] [Required]
public string NugetVersion { get; set; } public string NugetVersion { get; set; }
public bool Coherent { get; set; }
private AzurePublisher AzurePublisherTool private AzurePublisher AzurePublisherTool
{ {
get get
@ -81,6 +83,10 @@ namespace Microsoft.DotNet.Cli.Build
string cliVersion = Utils.GetVersionFileContent(CommitHash, NugetVersion); string cliVersion = Utils.GetVersionFileContent(CommitHash, NugetVersion);
AzurePublisherTool.PublishStringToBlob($"{targetFolder}/latest.version", cliVersion); AzurePublisherTool.PublishStringToBlob($"{targetFolder}/latest.version", cliVersion);
if (Coherent == true)
{
AzurePublisherTool.PublishStringToBlob($"{targetFolder}/latest.coherent.version", cliVersion);
}
} }
finally finally
{ {

View file

@ -28,6 +28,7 @@
<Import Project="build/Version.props" /> <Import Project="build/Version.props" />
<Import Project="build/Branding.props" /> <Import Project="build/Branding.props" />
<Import Project="build/DerivedHostMachineInfo.props" />
<Import Project="build/FileExtensions.props" /> <Import Project="build/FileExtensions.props" />
<Import Project="build/InputDirectories.props" /> <Import Project="build/InputDirectories.props" />
<Import Project="build/MSBuildExtensions.props" /> <Import Project="build/MSBuildExtensions.props" />

View file

@ -104,7 +104,7 @@ while [[ $# > 0 ]]; do
;; ;;
--linux-portable) --linux-portable)
LINUX_PORTABLE_INSTALL_ARGS="--runtime-id linux-x64" LINUX_PORTABLE_INSTALL_ARGS="--runtime-id linux-x64"
CUSTOM_BUILD_ARGS="/p:Rid=\"linux-x64\" /p:OSName=\"linux\"" CUSTOM_BUILD_ARGS="/p:Rid=\"linux-x64\" /p:OSName=\"linux\" /p:IslinuxPortable=\"true\""
args=( "${args[@]/$1}" ) args=( "${args[@]/$1}" )
;; ;;
--help) --help)

View file

@ -11,13 +11,21 @@
it will update it only if the requested version differs from the one already installed. it will update it only if the requested version differs from the one already installed.
.PARAMETER Channel .PARAMETER Channel
Default: LTS Default: LTS
Download from the Channel specified Download from the Channel specified. Possible values:
- Current - most current release
- LTS - most current supported release
- 2-part version in a format A.B - represents a specific release
examples: 2.0; 1.0
- Branch name
examples: release/2.0.0; Master
.PARAMETER Version .PARAMETER Version
Default: latest Default: latest
Represents a build version on specific channel. Possible values: Represents a build version on specific channel. Possible values:
- latest - most latest build on specific channel - latest - most latest build on specific channel
- coherent - most latest coherent build on specific channel
coherent applies only to SDK downloads
- 3-part version in a format A.B.C - represents specific version of build - 3-part version in a format A.B.C - represents specific version of build
examples: 2.0.0-preview2-006120; 1.1.0 examples: 2.0.0-preview2-006120; 1.1.0
.PARAMETER InstallDir .PARAMETER InstallDir
Default: %LocalAppData%\Microsoft\dotnet Default: %LocalAppData%\Microsoft\dotnet
Path to where to install dotnet. Note that binaries will be placed directly in a given directory. Path to where to install dotnet. Note that binaries will be placed directly in a given directory.
@ -28,8 +36,6 @@
.PARAMETER SharedRuntime .PARAMETER SharedRuntime
Default: false Default: false
Installs just the shared runtime bits, not the entire SDK Installs just the shared runtime bits, not the entire SDK
.PARAMETER DebugSymbols
If set the installer will include symbols in the installation.
.PARAMETER DryRun .PARAMETER DryRun
If set it will not perform installation but instead display what command line to use to consistently install 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 currently requested version of dotnet cli. In example if you specify version 'latest' it will display a link
@ -60,7 +66,6 @@ param(
[string]$InstallDir="<auto>", [string]$InstallDir="<auto>",
[string]$Architecture="<auto>", [string]$Architecture="<auto>",
[switch]$SharedRuntime, [switch]$SharedRuntime,
[switch]$DebugSymbols, # TODO: Switch does not work yet. Symbols zip is not being uploaded yet.
[switch]$DryRun, [switch]$DryRun,
[switch]$NoPath, [switch]$NoPath,
[string]$AzureFeed="https://dotnetcli.azureedge.net/dotnet", [string]$AzureFeed="https://dotnetcli.azureedge.net/dotnet",
@ -207,7 +212,7 @@ function GetHTTPResponse([Uri] $Uri)
} }
function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) { function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Coherent) {
Say-Invocation $MyInvocation Say-Invocation $MyInvocation
$VersionFileUrl = $null $VersionFileUrl = $null
@ -215,7 +220,12 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) {
$VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version" $VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version"
} }
else { else {
$VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version" if ($Coherent) {
$VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.coherent.version"
}
else {
$VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version"
}
} }
$Response = GetHTTPResponse -Uri $VersionFileUrl $Response = GetHTTPResponse -Uri $VersionFileUrl
@ -239,7 +249,11 @@ function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel,
switch ($Version.ToLower()) { switch ($Version.ToLower()) {
{ $_ -eq "latest" } { { $_ -eq "latest" } {
$LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $False
return $LatestVersionInfo.Version
}
{ $_ -eq "coherent" } {
$LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $True
return $LatestVersionInfo.Version return $LatestVersionInfo.Version
} }
default { return $Version } default { return $Version }
@ -464,14 +478,17 @@ if ($free.Freespace / 1MB -le 100 ) {
} }
$ZipPath = [System.IO.Path]::GetTempFileName() $ZipPath = [System.IO.Path]::GetTempFileName()
Say "Downloading $DownloadLink" Say-Verbose "Zip path: $ZipPath"
Say "Downloading link: $DownloadLink"
try { try {
DownloadFile -Uri $DownloadLink -OutPath $ZipPath DownloadFile -Uri $DownloadLink -OutPath $ZipPath
} }
catch { catch {
Say "Cannot download: $DownloadLink"
$DownloadLink = $LegacyDownloadLink $DownloadLink = $LegacyDownloadLink
$ZipPath = [System.IO.Path]::GetTempFileName() $ZipPath = [System.IO.Path]::GetTempFileName()
Say "Downloading $DownloadLink" Say-Verbose "Legacy zip path: $ZipPath"
Say "Downloading legacy link: $DownloadLink"
DownloadFile -Uri $DownloadLink -OutPath $ZipPath DownloadFile -Uri $DownloadLink -OutPath $ZipPath
} }

View file

@ -147,7 +147,7 @@ get_distro_specific_os_name() {
fi fi
fi fi
say_verbose "Distribution specific OS name + version could not be detected: $ID.$VERSION_ID" say_verbose "Distribution specific OS name and version could not be detected: $ID.$VERSION_ID"
return 1 return 1
} }
@ -339,12 +339,17 @@ get_latest_version_info() {
local azure_feed=$1 local azure_feed=$1
local channel=$2 local channel=$2
local normalized_architecture=$3 local normalized_architecture=$3
local coherent=$4
local version_file_url=null local version_file_url=null
if [ "$shared_runtime" = true ]; then if [ "$shared_runtime" = true ]; then
version_file_url="$uncached_feed/Runtime/$channel/latest.version" version_file_url="$uncached_feed/Runtime/$channel/latest.version"
else else
version_file_url="$uncached_feed/Sdk/$channel/latest.version" if [ "$coherent" = true ]; then
version_file_url="$uncached_feed/Runtime/$channel/latest.coherent.version"
else
version_file_url="$uncached_feed/Sdk/$channel/latest.version"
fi
fi fi
say_verbose "get_latest_version_info: latest url: $version_file_url" say_verbose "get_latest_version_info: latest url: $version_file_url"
@ -368,7 +373,14 @@ get_specific_version_from_version() {
case $version in case $version in
latest) latest)
local version_info local version_info
version_info="$(get_latest_version_info $azure_feed $channel $normalized_architecture)" || return 1 version_info="$(get_latest_version_info $azure_feed $channel $normalized_architecture false)" || return 1
say_verbose "get_specific_version_from_version: version_info=$version_info"
echo "$version_info" | get_version_from_version_info
return 0
;;
coherent)
local version_info
version_info="$(get_latest_version_info $azure_feed $channel $normalized_architecture true)" || return 1
say_verbose "get_specific_version_from_version: version_info=$version_info" say_verbose "get_specific_version_from_version: version_info=$version_info"
echo "$version_info" | get_version_from_version_info echo "$version_info" | get_version_from_version_info
return 0 return 0
@ -647,13 +659,14 @@ install_dotnet() {
# if the download fails, download the legacy_download_link # if the download fails, download the legacy_download_link
if [ "$download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then if [ "$download_failed" = true ] && [ "$valid_legacy_download_link" = true ]; then
say "Cannot download: $download_link" say "Cannot download: $download_link"
download_link=$legacy_download_link
zip_path=$(mktemp $temporary_file_template) zip_path=$(mktemp $temporary_file_template)
say_verbose "Legacy zip path: $zip_path" say_verbose "Legacy zip path: $zip_path"
say "Downloading legacy link: $legacy_download_link" say "Downloading legacy link: $download_link"
download "$legacy_download_link" $zip_path download "$download_link" $zip_path
fi fi
say "Extracting zip" say "Extracting zip from $download_link"
extract_dotnet_package $zip_path $install_root extract_dotnet_package $zip_path $install_root
return 0 return 0
@ -667,7 +680,6 @@ channel="LTS"
version="Latest" version="Latest"
install_dir="<auto>" install_dir="<auto>"
architecture="<auto>" architecture="<auto>"
debug_symbols=false
dry_run=false dry_run=false
no_path=false no_path=false
azure_feed="https://dotnetcli.azureedge.net/dotnet" azure_feed="https://dotnetcli.azureedge.net/dotnet"
@ -699,9 +711,6 @@ do
--shared-runtime|-[Ss]hared[Rr]untime) --shared-runtime|-[Ss]hared[Rr]untime)
shared_runtime=true shared_runtime=true
;; ;;
--debug-symbols|-[Dd]ebug[Ss]ymbols)
debug_symbols=true
;;
--dry-run|-[Dd]ry[Rr]un) --dry-run|-[Dd]ry[Rr]un)
dry_run=true dry_run=true
;; ;;
@ -732,17 +741,29 @@ do
echo "$script_name is a simple command line interface for obtaining dotnet cli." echo "$script_name is a simple command line interface for obtaining dotnet cli."
echo "" echo ""
echo "Options:" echo "Options:"
echo " -c,--channel <CHANNEL> Download from the CHANNEL specified (default: $channel)." echo " -c,--channel <CHANNEL> Download from the CHANNEL specified, Defaults to \`$channel\`."
echo " -Channel" echo " -Channel"
echo " -v,--version <VERSION> Use specific version, or \`latest\`. Defaults to \`latest\`." echo " Possible values:"
echo " - Current - most current release"
echo " - LTS - most current supported release"
echo " - 2-part version in a format A.B - represents a specific release"
echo " examples: 2.0; 1.0"
echo " - Branch name"
echo " examples: release/2.0.0; Master"
echo " -v,--version <VERSION> Use specific VERSION, Defaults to \`$version\`."
echo " -Version" echo " -Version"
echo " Possible values:"
echo " - latest - most latest build on specific channel"
echo " - coherent - most latest coherent build on specific channel"
echo " coherent applies only to SDK downloads"
echo " - 3-part version in a format A.B.C - represents specific version of build"
echo " examples: 2.0.0-preview2-006120; 1.1.0"
echo " -i,--install-dir <DIR> Install under specified location (see Install Location below)" echo " -i,--install-dir <DIR> Install under specified location (see Install Location below)"
echo " -InstallDir" echo " -InstallDir"
echo " --architecture <ARCHITECTURE> Architecture of .NET Tools. Currently only x64 is supported." echo " --architecture <ARCHITECTURE> Architecture of .NET Tools. Currently only x64 is supported."
echo " --arch,-Architecture,-Arch" echo " --arch,-Architecture,-Arch"
echo " --shared-runtime Installs just the shared runtime bits, not the entire SDK." echo " --shared-runtime Installs just the shared runtime bits, not the entire SDK."
echo " -SharedRuntime" 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 " --dry-run,-DryRun Do not perform installation. Display download link."
echo " --no-path, -NoPath Do not set PATH for the current process." echo " --no-path, -NoPath Do not set PATH for the current process."
echo " --verbose,-Verbose Display diagnostics information." echo " --verbose,-Verbose Display diagnostics information."

View file

@ -8,11 +8,14 @@ namespace Microsoft.DotNet.Cli.Utils
{ {
public class AnsiConsole public class AnsiConsole
{ {
private const int Light = 0x08;
private AnsiConsole(TextWriter writer) private AnsiConsole(TextWriter writer)
{ {
Writer = writer; Writer = writer;
OriginalForegroundColor = Console.ForegroundColor; OriginalForegroundColor = Console.ForegroundColor;
_boldRecursion = ((int)OriginalForegroundColor & Light) != 0 ? 1 : 0;
} }
private int _boldRecursion; private int _boldRecursion;
@ -33,7 +36,6 @@ namespace Microsoft.DotNet.Cli.Utils
private void SetColor(ConsoleColor color) private void SetColor(ConsoleColor color)
{ {
const int Light = 0x08;
int c = (int)color; int c = (int)color;
Console.ForegroundColor = Console.ForegroundColor =