From 8dae7a7daba27aeaf25a489b0a2ea0f5e7d85e01 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Fri, 1 Jul 2016 17:11:00 +1200 Subject: [PATCH] -Build --- Build/build.ps1 | 2 +- Src/Newtonsoft.Json.Tests/project.json | 2 +- Tools/Dotnet/install.ps1 | 50 ++++++++++++++++++-------- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index 9437abcd..90c4bf54 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -11,7 +11,7 @@ $buildNuGet = $true $treatWarningsAsErrors = $false $workingName = if ($workingName) {$workingName} else {"Working"} - $netCliVersion = "1.0.0-preview1-002702" + $netCliVersion = "1.0.0-preview3-003171" $baseDir = resolve-path .. $buildDir = "$baseDir\Build" diff --git a/Src/Newtonsoft.Json.Tests/project.json b/Src/Newtonsoft.Json.Tests/project.json index 909cc9a0..42112319 100644 --- a/Src/Newtonsoft.Json.Tests/project.json +++ b/Src/Newtonsoft.Json.Tests/project.json @@ -96,7 +96,7 @@ "System.Runtime.Serialization.Json": "4.0.2", "System.Runtime.Serialization.Xml": "4.1.1", "xunit": "2.1.0", - "dotnet-test-xunit": "1.0.0-rc2-build10015" + "dotnet-test-xunit": "1.0.0-rc2-build10025" }, "imports": [ "dnxcore50", diff --git a/Tools/Dotnet/install.ps1 b/Tools/Dotnet/install.ps1 index 8b0ac72d..f863814c 100644 --- a/Tools/Dotnet/install.ps1 +++ b/Tools/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 @@ -47,10 +50,11 @@ #> [cmdletbinding()] param( - [string]$Channel="preview", + [string]$Channel="rel-1.0.0", [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, @@ -68,11 +72,11 @@ $VersionRegEx="/\d+\.\d+[^/]+/" $OverrideNonVersionedFiles=$true function Say($str) { - Write-Host "dotnet_install: $str" + Write-Host "dotnet-install: $str" } function Say-Verbose($str) { - Write-Verbose "dotnet_install: $str" + Write-Verbose "dotnet-install: $str" } function Say-Invocation($Invocation) { @@ -114,9 +118,22 @@ 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/Sdk/$AzureChannel/latest.version" + } + $Response = Invoke-WebRequest -UseBasicParsing $VersionFileUrl - $VersionText = [Text.Encoding]::UTF8.GetString($Response.Content) + + switch ($Response.Headers.'Content-Type'){ + { ($_ -eq "application/octet-stream") } { $VersionText = [Text.Encoding]::UTF8.GetString($Response.Content) } + { ($_ -eq "text/plain") } { $VersionText = $Response.Content } + default { throw "``$Response.Headers.'Content-Type'`` is an unknown .version file content type." } + } + $VersionInfo = Get-Version-Info-From-Version-Text $VersionText @@ -130,9 +147,8 @@ function Get-Azure-Channel-From-Channel([string]$Channel) { # For compatibility with build scripts accept also directly Azure channels names switch ($Channel.ToLower()) { { ($_ -eq "future") -or ($_ -eq "dev") } { return "dev" } - { ($_ -eq "preview") -or ($_ -eq "beta") } { return "beta" } { $_ -eq "production" } { throw "Production channel does not exist yet" } - default { throw "``$Channel`` is an invalid channel name. Use one of the following: ``future``, ``preview``, ``production``" } + default { return $_ } } } @@ -153,13 +169,16 @@ function Get-Download-Links([string]$AzureFeed, [string]$AzureChannel, [string]$ Say-Invocation $MyInvocation $ret = @() - $files = @("dotnet-dev") - foreach ($file in $files) { - $PayloadURL = "$AzureFeed/$AzureChannel/Binaries/$SpecificVersion/$file-win-$CLIArchitecture.$SpecificVersion.zip" - Say-Verbose "Constructed payload URL: $PayloadURL" - $ret += $PayloadURL + if ($SharedRuntime) { + $PayloadURL = "$AzureFeed/$AzureChannel/Binaries/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip" } + else { + $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip" + } + + Say-Verbose "Constructed payload URL: $PayloadURL" + $ret += $PayloadURL return $ret } @@ -300,7 +319,7 @@ if ($DryRun) { Say "- $DownloadLink" } Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir" - return + exit 0 } $InstallRoot = Resolve-Installation-Path $InstallDir @@ -310,7 +329,7 @@ $IsSdkInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -Relativ Say-Verbose ".NET SDK installed? $IsSdkInstalled" if ($IsSdkInstalled) { Say ".NET SDK version $SpecificVersion is already installed." - return + exit 0 } New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null @@ -329,10 +348,11 @@ foreach ($DownloadLink in $DownloadLinks) { $BinPath = Get-Absolute-Path $(Join-Path -Path $InstallRoot -ChildPath $BinFolderRelativePath) if (-Not $NoPath) { Say "Adding to current process PATH: `"$BinPath`". Note: This change will not be visible if PowerShell was run as a child process." - $env:path += ";$BinPath" + $env:path = "$BinPath;" + $env:path } else { Say "Binaries of dotnet can be found in $BinPath" } Say "Installation finished" +exit 0 \ No newline at end of file