* Add a switch to specify a version to KoreBuild

* Use a fixed version of the CLI until build issues are resolved.
This commit is contained in:
Pranav K 2016-02-09 11:28:44 -08:00
parent de449ee249
commit ba7f46d3bc
4 changed files with 49 additions and 24 deletions

View File

@ -13,6 +13,10 @@ IF "%KOREBUILD_DOTNET_CHANNEL%"=="" (
SET KOREBUILD_DOTNET_CHANNEL=beta
)
IF "%KOREBUILD_DOTNET_VERSION%"=="" (
SET KOREBUILD_DOTNET_VERSION=1.0.0.001248
)
IF NOT EXIST Sake (
"%NUGET_PATH%" install Sake -ExcludeVersion -Source https://api.nuget.org/v3/index.json -o %~dp0
)
@ -33,7 +37,7 @@ IF "%KOREBUILD_SKIP_RUNTIME_INSTALL%"=="1" (
SET DOTNET_LOCAL_INSTALL_FOLDER=%LOCALAPPDATA%\Microsoft\dotnet\cli
SET DOTNET_LOCAL_INSTALL_FOLDER_BIN=%DOTNET_LOCAL_INSTALL_FOLDER%\bin
CALL %~dp0dotnet-install.cmd -Channel %KOREBUILD_DOTNET_CHANNEL%
CALL %~dp0dotnet-install.cmd -Channel %KOREBUILD_DOTNET_CHANNEL% -Version %KOREBUILD_DOTNET_VERSION%
ECHO Adding %DOTNET_LOCAL_INSTALL_FOLDER_BIN% to PATH
SET PATH=%DOTNET_LOCAL_INSTALL_FOLDER_BIN%;%PATH%

View File

@ -1,6 +1,7 @@
#!/usr/bin/env bash
[ -z "$KOREBUILD_DOTNET_CHANNEL" ] && KOREBUILD_DOTNET_CHANNEL=beta
[ -z "$KOREBUILD_DOTNET_VERSION" ] && KOREBUILD_DOTNET_VERSION=1.0.0.001248
targets=""
filename=$0
@ -60,7 +61,7 @@ else
export DOTNET_HOME=$DOTNET_INSTALL_DIR/share/dotnet/cli
export KOREBUILD_FOLDER="$(dirname $thisDir)"
chmod +x $thisDir/dotnet-install.sh
$thisDir/dotnet-install.sh --channel $KOREBUILD_DOTNET_CHANNEL
$thisDir/dotnet-install.sh --channel $KOREBUILD_DOTNET_CHANNEL --version $KOREBUILD_DOTNET_VERSION
# ==== Temporary ====
if ! type dnvm > /dev/null 2>&1; then
source $thisDir/dnvm.sh

View File

@ -3,15 +3,21 @@
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
param([string]$Channel="dev")
param(
[string]$Channel="dev",
[string]$version="Latest"
)
$ErrorActionPreference="Stop"
$ProgressPreference="SilentlyContinue"
$fileVersion = $Version
if ($fileVersion -eq "Latest") {
$fileVersion = "latest"
}
$Feed="https://dotnetcli.blob.core.windows.net/dotnet"
$DotNetFileName="dotnet-win-x64.latest.zip"
$DotNetUrl="$Feed/$Channel/Binaries/Latest"
$DotNetFileName="dotnet-win-x64.$fileVersion.zip"
$DotNetUrl="$Feed/$Channel/Binaries/$Version"
function say($str)
{
@ -34,21 +40,29 @@ if (Test-Path $LocalFile)
$LocalVersion = $LocalData[1].Trim()
if ($LocalVersion -and $LocalHash)
{
$RemoteResponse = Invoke-WebRequest -UseBasicParsing "$Feed/$Channel/dnvm/latest.win.version"
$RemoteData = @([Text.Encoding]::UTF8.GetString($RemoteResponse.Content).Split([char[]]@(), [StringSplitOptions]::RemoveEmptyEntries));
$RemoteHash = $RemoteData[0].Trim()
$RemoteVersion = $RemoteData[1].Trim()
if (!$RemoteVersion -or !$RemoteHash) {
throw "Invalid response from feed"
}
say "Latest version: $RemoteVersion"
say "Local Version: $LocalVersion"
if($LocalHash -eq $RemoteHash)
if ($Version -eq "Latest")
{
say "You already have the latest version"
$RemoteResponse = Invoke-WebRequest -UseBasicParsing "$Feed/$Channel/dnvm/latest.win.version"
$RemoteData = @([Text.Encoding]::UTF8.GetString($RemoteResponse.Content).Split([char[]]@(), [StringSplitOptions]::RemoveEmptyEntries));
$RemoteHash = $RemoteData[0].Trim()
$RemoteVersion = $RemoteData[1].Trim()
if (!$RemoteVersion -or !$RemoteHash) {
throw "Invalid response from feed"
}
say "Latest version: $RemoteVersion"
say "Local Version: $LocalVersion"
if($LocalHash -eq $RemoteHash)
{
say "You already have the latest version"
exit 0
}
}
elseif ($LocalVersion -eq $Version)
{
say "$Version is already installed."
exit 0
}
}

View File

@ -1,5 +1,3 @@
#!/usr/bin/env sh
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
@ -162,10 +160,17 @@ install_dotnet()
say_err "Ending install due to missing pre-reqs"
return 1;
fi
if [ "$VERSION" == "Latest" ]; then
local fileVersion=latest
else
local fileVersion=$VERSION
fi
local os=$(current_os)
local installLocation="$PREFIX/share/dotnet"
local dotnet_url="https://dotnetcli.blob.core.windows.net/dotnet/$CHANNEL/Binaries/Latest"
local dotnet_filename="dotnet-$os-x64.latest.tar.gz"
local dotnet_url="https://dotnetcli.blob.core.windows.net/dotnet/$CHANNEL/Binaries/$VERSION"
local dotnet_filename="dotnet-$os-x64.$fileVersion.tar.gz"
if [ "$RELINK" = "0" ]; then
if [ "$FORCE" = "0" ]; then
@ -288,5 +293,6 @@ elif [ -z "$PREFIX" ]; then
fi
[ -z "$CHANNEL" ] && CHANNEL="dev"
[ -z "$VERSION" ] && VERSION="Latest"
install_dotnet