From aa53be86c5c3e0a2d3e6be62af4f0c5e1b5b067e Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Thu, 6 Apr 2017 23:38:53 -0700 Subject: [PATCH] Skip installing shared runtimes when KOREBUILD_SKIP_RUNTIME_INSTALL is 1 --- build/KoreBuild.ps1 | 22 +++++++++++----------- build/KoreBuild.sh | 16 ++++++++-------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build/KoreBuild.ps1 b/build/KoreBuild.ps1 index 8bb810e..b80d82e 100644 --- a/build/KoreBuild.ps1 +++ b/build/KoreBuild.ps1 @@ -71,6 +71,17 @@ else { # Install the version of dotnet-cli used to compile & "$PSScriptRoot\dotnet\dotnet-install.ps1" -Channel $dotnetChannel -Version $dotnetVersion -Architecture x64 + + # Temporarily install these runtimes to prevent build breaks for repos not yet converted + # 1.0.4 - for tools + InstallSharedRuntime -version "1.0.4" -channel "preview" + # 1.1.1 - for test projects which haven't yet been converted to netcoreapp2.0 + InstallSharedRuntime -version "1.1.1" -channel "release/1.1.0" + + if ($sharedRuntimeVersion) + { + InstallSharedRuntime -version $sharedRuntimeVersion -channel $sharedRuntimeChannel + } } if (!($env:Path.Split(';') -icontains $dotnetLocalInstallFolder)) @@ -79,17 +90,6 @@ if (!($env:Path.Split(';') -icontains $dotnetLocalInstallFolder)) $env:Path = "$newPath" } -# Temporarily install these runtimes to prevent build breaks for repos not yet converted -# 1.0.4 - for tools -InstallSharedRuntime -version "1.0.4" -channel "preview" -# 1.1.1 - for test projects which haven't yet been converted to netcoreapp2.0 -InstallSharedRuntime -version "1.1.1" -channel "release/1.1.0" - -if ($sharedRuntimeVersion) -{ - InstallSharedRuntime -version $sharedRuntimeVersion -channel $sharedRuntimeChannel -} - # wokaround for CLI issue: https://github.com/dotnet/cli/issues/2143 $sharedPath = (Join-Path (Split-Path ((get-command dotnet.exe).Path) -Parent) "shared"); (Get-ChildItem $sharedPath -Recurse *dotnet.exe) | %{ $_.FullName } | Remove-Item; diff --git a/build/KoreBuild.sh b/build/KoreBuild.sh index dc2cf6b..9ef7487 100755 --- a/build/KoreBuild.sh +++ b/build/KoreBuild.sh @@ -121,16 +121,16 @@ else # Add .NET installation directory to the path if it isn't yet included. [[ ":$PATH:" != *":$DOTNET_INSTALL_DIR:"* ]] && export PATH="$DOTNET_INSTALL_DIR:$PATH" -fi -# Temporarily install these runtimes to prevent build breaks for repos not yet converted -# 1.0.4 - for tools -install_shared_runtime "1.0.4" "preview" -# 1.1.1 - for test projects which haven't yet been converted to netcoreapp2.0 -install_shared_runtime "1.1.1" "release/1.1.0" + # Temporarily install these runtimes to prevent build breaks for repos not yet converted + # 1.0.4 - for tools + install_shared_runtime "1.0.4" "preview" + # 1.1.1 - for test projects which haven't yet been converted to netcoreapp2.0 + install_shared_runtime "1.1.1" "release/1.1.0" -if [ "$sharedRuntimeVersion" != "" ]; then - install_shared_runtime $KOREBUILD_DOTNET_SHARED_RUNTIME_VERSION $KOREBUILD_DOTNET_SHARED_RUNTIME_CHANNEL + if [ "$sharedRuntimeVersion" != "" ]; then + install_shared_runtime $KOREBUILD_DOTNET_SHARED_RUNTIME_VERSION $KOREBUILD_DOTNET_SHARED_RUNTIME_CHANNEL + fi fi # workaround for CLI issue: https://github.com/dotnet/cli/issues/2143