Skip to content

Commit

Permalink
Add installation of .NET 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Wasapl committed Feb 21, 2020
1 parent 081e240 commit 0adc23c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 19 deletions.
4 changes: 4 additions & 0 deletions scripts/Ubuntu/basicconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ install_dotnets ||
_abort $?
install_dotnetv5_preview ||
_abort $?
preheat_dotnet_sdks &&
log_version dotnet --list-sdks &&
log_version dotnet --list-runtimes ||
_abort $?
su -l ${USER_NAME} -c "
USER_NAME=${USER_NAME}
$(declare -f configure_nuget)
Expand Down
15 changes: 5 additions & 10 deletions scripts/Ubuntu/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -799,16 +799,6 @@ function install_dotnets() {

#cleanup
if [ -f packages-microsoft-prod.deb ]; then rm packages-microsoft-prod.deb; fi

#pre-heat
preheat_dotnet_sdks
log_version dotnet --list-sdks
log_version dotnet --list-runtimes
}

function prerequisites_dotnetv3_preview () {
# https://github.com/dotnet/core/blob/master/Documentation/linux-prereqs.md
echo "libicu"
}

function install_dotnetv5_preview() {
Expand All @@ -835,6 +825,11 @@ function install_dotnetv5_preview() {
log_version dotnet --list-runtimes
}

function prerequisites_dotnetv3_preview () {
# https://github.com/dotnet/core/blob/master/Documentation/linux-prereqs.md
echo "libicu"
}

function install_dotnetv3_preview() {
echo "[INFO] Running install_dotnetv3_preview..."
local DOTNET3_SDK_URL
Expand Down
7 changes: 6 additions & 1 deletion scripts/macos/basicconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ su -l "${USER_NAME}" -c "
$(declare -f write_line)
$(declare -f global_json)
$(declare -f preheat_dotnet_sdks)
$(declare -f install_dotnetv5_preview)
$(declare -f install_dotnets)
install_dotnets" ||
install_dotnets
install_dotnetv5_preview
preheat_dotnet_sdks
log_version dotnet --list-sdks
log_version dotnet --list-runtimes" ||
_abort $?
install_cocoapods
install_mono
Expand Down
35 changes: 27 additions & 8 deletions scripts/macos/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,33 @@ function preheat_dotnet_sdks() {
done
}

function install_dotnetv5_preview() {
echo "[INFO] Running install_dotnetv5_preview..."
# this must be executed as appveyor user
if [ "$(whoami)" != "${USER_NAME}" ]; then
echo "This script must be run as '${USER_NAME}'. Current user is '$(whoami)'" 1>&2
return 1
fi
local DOTNET5_SDK_URL
if [[ -z "${1-}" || "${#1}" = "0" ]]; then
DOTNET5_SDK_URL="https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-osx-x64.tar.gz"
else
DOTNET5_SDK_URL=$1
fi
local DOTNET5_SDK_TAR=${DOTNET5_SDK_URL##*/}

local TMP_DIR
TMP_DIR=$(mktemp -d)
pushd -- "${TMP_DIR}"

curl -fsSL -O "${DOTNET5_SDK_URL}" &&
tar -zxf "${DOTNET5_SDK_TAR}" -C "${HOME}/.dotnet" ||
{ echo "[ERROR] Cannot download and unpack .NET SDK 5.0 preview from url '${DOTNET5_SDK_URL}'." 1>&2; popd; return 20; }

popd &&
rm -rf "${TMP_DIR}"
}

function install_dotnets() {
echo "[INFO] Running install_dotnets..."
# this must be executed as appveyor user
Expand All @@ -436,14 +463,6 @@ function install_dotnets() {
#shellcheck disable=SC2016
write_line "${HOME}/.profile" 'add2path_suffix $HOME/.dotnet'
export PATH="$PATH:$HOME/.dotnet"

if command -v dotnet; then
preheat_dotnet_sdks
log_version dotnet --list-sdks
log_version dotnet --list-runtimes
else
echo "[WARNING] Cannot find 'dotnet' executable in PATH. .NET not configured properly."
fi
}

function install_gvm_and_golangs() {
Expand Down

0 comments on commit 0adc23c

Please sign in to comment.