forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee8a741
commit 026585e
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 1.0.{build} | ||
install: | ||
- ps: fcs/installSDK.ps1 | ||
build_script: | ||
- cmd: fcs/build.cmd | ||
test: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Ensures that .net core is up to date. | ||
# first get the required version from global.json | ||
$json = ConvertFrom-Json (Get-Content "$PSScriptRoot/global.json" -Raw) | ||
$required_version = $json.sdk.version | ||
|
||
# Running dotnet --version stupidly fails if the required SDK version is higher | ||
# than the currently installed version. So move global.json out the way | ||
# and then put it back again | ||
Rename-Item "$PSScriptRoot/global.json" "$PSScriptRoot/global.json.bak" | ||
$current_version = (dotnet --version) | ||
Rename-Item "$PSScriptRoot/global.json.bak" "$PSScriptRoot/global.json" | ||
Write-Host "Required .NET version: $required_version, Installed: $current_version" | ||
|
||
if ($current_version -lt $required_version) { | ||
# Current installed version is too low. | ||
# Install new version as a local only dependency. | ||
$urlCurrent = "https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$required_version/dotnet-sdk-$required_version-win-x64.zip" | ||
Write-Host "Installing .NET Core $required_version from $urlCurrent" | ||
$env:DOTNET_INSTALL_DIR = "$PSScriptRoot/.dotnetsdk" | ||
New-Item -Type Directory $env:DOTNET_INSTALL_DIR -Force | Out-Null | ||
(New-Object System.Net.WebClient).DownloadFile($urlCurrent, "dotnet.zip") | ||
Write-Host "Unzipping to $env:DOTNET_INSTALL_DIR" | ||
Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory("dotnet.zip", $env:DOTNET_INSTALL_DIR) | ||
|
||
Write-Host "Using .NET SDK from $env:DOTNET_INSTALL_DIR" | ||
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" | ||
} |