Acquire dotnet-install.ps1 from dot.net (#1849)
This commit is contained in:
+15
-2
@@ -70,6 +70,8 @@ task Build -depends Clean {
|
||||
Write-Host -ForegroundColor Green "Found $($script:enabledBuilds.Length) enabled builds"
|
||||
|
||||
mkdir "$buildDir\Temp" -Force
|
||||
|
||||
EnsureDotNetCli
|
||||
EnsureNuGetExists
|
||||
EnsureNuGetPackage "vswhere" $vswherePath $vswhereVersion
|
||||
EnsureNuGetPackage "NUnit.ConsoleRunner" $nunitConsolePath $nunitConsoleVersion
|
||||
@@ -161,6 +163,19 @@ function NetCliBuild()
|
||||
exec { & $script:msBuildPath "/t:build" "/v:$msbuildVerbosity" $projectPath "/p:Configuration=Release" "/p:LibraryFrameworks=`"$libraryFrameworks`"" "/p:TestFrameworks=`"$testFrameworks`"" "/p:AssemblyOriginatorKeyFile=$signKeyPath" "/p:SignAssembly=$signAssemblies" "/p:TreatWarningsAsErrors=$treatWarningsAsErrors" "/p:AdditionalConstants=$additionalConstants" "/p:GeneratePackageOnBuild=$buildNuGet" "/p:ContinuousIntegrationBuild=true" "/p:PackageId=$packageId" "/p:VersionPrefix=$majorWithReleaseVersion" "/p:VersionSuffix=$nugetPrerelease" "/p:AssemblyVersion=$assemblyVersion" "/p:FileVersion=$version" "/m" }
|
||||
}
|
||||
|
||||
function EnsureDotnetCli()
|
||||
{
|
||||
Write-Host "Downloading dotnet-install.ps1"
|
||||
|
||||
# https://stackoverflow.com/questions/36265534/invoke-webrequest-ssl-fails
|
||||
[Net.ServicePointManager]::SecurityProtocol = 'TLS12'
|
||||
Invoke-WebRequest `
|
||||
-Uri "https://dot.net/v1/dotnet-install.ps1" `
|
||||
-OutFile "$buildDir\Temp\dotnet-install.ps1"
|
||||
|
||||
exec { & $buildDir\Temp\dotnet-install.ps1 -Channel $netCliChannel -Version $netCliVersion | Out-Default }
|
||||
}
|
||||
|
||||
function EnsureNuGetExists()
|
||||
{
|
||||
if (!(Test-Path $nugetPath))
|
||||
@@ -194,8 +209,6 @@ function NetCliTests($build)
|
||||
$location = "$sourceDir\Newtonsoft.Json.Tests"
|
||||
$testDir = if ($build.TestFramework -ne $null) { $build.TestFramework } else { $build.Framework }
|
||||
|
||||
exec { .\Tools\Dotnet\dotnet-install.ps1 -Channel $netCliChannel -Version $netCliVersion | Out-Default }
|
||||
|
||||
try
|
||||
{
|
||||
Set-Location $location
|
||||
|
||||
Reference in New Issue
Block a user