build/build.ps1: Modified script to install .NET Core 2.0 SDK if needed before running the tests
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/356cec57 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/356cec57 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/356cec57 Branch: refs/heads/master Commit: 356cec572388964f2d18f15b75aa9bc9c5f2da9f Parents: b3a2dd0 Author: Shad Storhaug <[email protected]> Authored: Mon Sep 11 08:46:58 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Mon Sep 11 08:46:58 2017 +0700 ---------------------------------------------------------------------- build/build.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/356cec57/build/build.ps1 ---------------------------------------------------------------------- diff --git a/build/build.ps1 b/build/build.ps1 index 9592b44..6547b14 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -59,7 +59,7 @@ task Clean -description "This task cleans up the build directory" { Get-ChildItem $base_directory -Include *.bak -Recurse | foreach ($_) {Remove-Item $_.FullName} } -task InstallSDK2 -description "This task makes sure the correct SDK version is installed to build and run .NET Core 2.0 tests" { +task InstallSDK -description "This task makes sure the correct SDK version is installed to build" { & where.exe dotnet.exe $sdkVersion = "0.0.0.0" @@ -83,6 +83,12 @@ task InstallSDK2 -description "This task makes sure the correct SDK version is i } } +task InstallSDK2IfRequired -description "This task installs the .NET Core 2.x SDK (required for testing under .NET Core 2.0)" { + if ($frameworks_to_test.Contains("netcoreapp2.")) { + Invoke-Task InstallSDK + } +} + task InstallSDK1IfRequired -description "This task installs the .NET Core 1.x SDK (required for testing under .NET Core 1.0)" { if ($frameworks_to_test.Contains("netcoreapp1.")) { # Make sure framework for .NET Core 1.0.4 is available @@ -199,7 +205,7 @@ task Pack -depends Compile -description "This task creates the NuGet packages" { } } -task Test -depends InstallSDK1IfRequired, Restore -description "This task runs the tests" { +task Test -depends InstallSDK1IfRequired, InstallSDK2IfRequired, Restore -description "This task runs the tests" { Write-Host "Running tests..." -ForegroundColor DarkCyan pushd $base_directory
