* 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:
parent
de449ee249
commit
ba7f46d3bc
|
|
@ -13,6 +13,10 @@ IF "%KOREBUILD_DOTNET_CHANNEL%"=="" (
|
||||||
SET KOREBUILD_DOTNET_CHANNEL=beta
|
SET KOREBUILD_DOTNET_CHANNEL=beta
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IF "%KOREBUILD_DOTNET_VERSION%"=="" (
|
||||||
|
SET KOREBUILD_DOTNET_VERSION=1.0.0.001248
|
||||||
|
)
|
||||||
|
|
||||||
IF NOT EXIST Sake (
|
IF NOT EXIST Sake (
|
||||||
"%NUGET_PATH%" install Sake -ExcludeVersion -Source https://api.nuget.org/v3/index.json -o %~dp0
|
"%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=%LOCALAPPDATA%\Microsoft\dotnet\cli
|
||||||
SET DOTNET_LOCAL_INSTALL_FOLDER_BIN=%DOTNET_LOCAL_INSTALL_FOLDER%\bin
|
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
|
ECHO Adding %DOTNET_LOCAL_INSTALL_FOLDER_BIN% to PATH
|
||||||
SET PATH=%DOTNET_LOCAL_INSTALL_FOLDER_BIN%;%PATH%
|
SET PATH=%DOTNET_LOCAL_INSTALL_FOLDER_BIN%;%PATH%
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
[ -z "$KOREBUILD_DOTNET_CHANNEL" ] && KOREBUILD_DOTNET_CHANNEL=beta
|
[ -z "$KOREBUILD_DOTNET_CHANNEL" ] && KOREBUILD_DOTNET_CHANNEL=beta
|
||||||
|
[ -z "$KOREBUILD_DOTNET_VERSION" ] && KOREBUILD_DOTNET_VERSION=1.0.0.001248
|
||||||
|
|
||||||
targets=""
|
targets=""
|
||||||
filename=$0
|
filename=$0
|
||||||
|
|
@ -60,7 +61,7 @@ else
|
||||||
export DOTNET_HOME=$DOTNET_INSTALL_DIR/share/dotnet/cli
|
export DOTNET_HOME=$DOTNET_INSTALL_DIR/share/dotnet/cli
|
||||||
export KOREBUILD_FOLDER="$(dirname $thisDir)"
|
export KOREBUILD_FOLDER="$(dirname $thisDir)"
|
||||||
chmod +x $thisDir/dotnet-install.sh
|
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 ====
|
# ==== Temporary ====
|
||||||
if ! type dnvm > /dev/null 2>&1; then
|
if ! type dnvm > /dev/null 2>&1; then
|
||||||
source $thisDir/dnvm.sh
|
source $thisDir/dnvm.sh
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,21 @@
|
||||||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
# 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"
|
$ErrorActionPreference="Stop"
|
||||||
$ProgressPreference="SilentlyContinue"
|
$ProgressPreference="SilentlyContinue"
|
||||||
|
|
||||||
|
$fileVersion = $Version
|
||||||
|
if ($fileVersion -eq "Latest") {
|
||||||
|
$fileVersion = "latest"
|
||||||
|
}
|
||||||
$Feed="https://dotnetcli.blob.core.windows.net/dotnet"
|
$Feed="https://dotnetcli.blob.core.windows.net/dotnet"
|
||||||
$DotNetFileName="dotnet-win-x64.latest.zip"
|
$DotNetFileName="dotnet-win-x64.$fileVersion.zip"
|
||||||
$DotNetUrl="$Feed/$Channel/Binaries/Latest"
|
$DotNetUrl="$Feed/$Channel/Binaries/$Version"
|
||||||
|
|
||||||
function say($str)
|
function say($str)
|
||||||
{
|
{
|
||||||
|
|
@ -34,21 +40,29 @@ if (Test-Path $LocalFile)
|
||||||
$LocalVersion = $LocalData[1].Trim()
|
$LocalVersion = $LocalData[1].Trim()
|
||||||
if ($LocalVersion -and $LocalHash)
|
if ($LocalVersion -and $LocalHash)
|
||||||
{
|
{
|
||||||
$RemoteResponse = Invoke-WebRequest -UseBasicParsing "$Feed/$Channel/dnvm/latest.win.version"
|
if ($Version -eq "Latest")
|
||||||
$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"
|
$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
|
exit 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
#
|
|
||||||
# Copyright (c) .NET Foundation and contributors. All rights reserved.
|
# 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.
|
# 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"
|
say_err "Ending install due to missing pre-reqs"
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$VERSION" == "Latest" ]; then
|
||||||
|
local fileVersion=latest
|
||||||
|
else
|
||||||
|
local fileVersion=$VERSION
|
||||||
|
fi
|
||||||
|
|
||||||
local os=$(current_os)
|
local os=$(current_os)
|
||||||
local installLocation="$PREFIX/share/dotnet"
|
local installLocation="$PREFIX/share/dotnet"
|
||||||
local dotnet_url="https://dotnetcli.blob.core.windows.net/dotnet/$CHANNEL/Binaries/Latest"
|
local dotnet_url="https://dotnetcli.blob.core.windows.net/dotnet/$CHANNEL/Binaries/$VERSION"
|
||||||
local dotnet_filename="dotnet-$os-x64.latest.tar.gz"
|
local dotnet_filename="dotnet-$os-x64.$fileVersion.tar.gz"
|
||||||
|
|
||||||
if [ "$RELINK" = "0" ]; then
|
if [ "$RELINK" = "0" ]; then
|
||||||
if [ "$FORCE" = "0" ]; then
|
if [ "$FORCE" = "0" ]; then
|
||||||
|
|
@ -288,5 +293,6 @@ elif [ -z "$PREFIX" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$CHANNEL" ] && CHANNEL="dev"
|
[ -z "$CHANNEL" ] && CHANNEL="dev"
|
||||||
|
[ -z "$VERSION" ] && VERSION="Latest"
|
||||||
|
|
||||||
install_dotnet
|
install_dotnet
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue