Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B8F79200D00 for ; Sun, 10 Sep 2017 16:11:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B782E1609B7; Sun, 10 Sep 2017 14:11:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0727D1609B4 for ; Sun, 10 Sep 2017 16:11:06 +0200 (CEST) Received: (qmail 58598 invoked by uid 500); 10 Sep 2017 14:11:05 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 58579 invoked by uid 99); 10 Sep 2017 14:11:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Sep 2017 14:11:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1D056F5523; Sun, 10 Sep 2017 14:11:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nightowl888@apache.org To: commits@lucenenet.apache.org Message-Id: <3f9b442780604f48bf615b1d6325ea1a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: lucenenet git commit: build/build.ps1: Added logic to fail the build when SDK installation fails. Setup scenario that will fail (non-existent SDK version) to test it with. Date: Sun, 10 Sep 2017 14:11:05 +0000 (UTC) archived-at: Sun, 10 Sep 2017 14:11:07 -0000 Repository: lucenenet Updated Branches: refs/heads/master 16ec7cd4a -> c02a98da4 build/build.ps1: Added logic to fail the build when SDK installation fails. Setup scenario that will fail (non-existent SDK version) to test it with. Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/c02a98da Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/c02a98da Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/c02a98da Branch: refs/heads/master Commit: c02a98da4a2c91d5ad205722e98ae096fafe8ce1 Parents: 16ec7cd Author: Shad Storhaug Authored: Sun Sep 10 21:10:55 2017 +0700 Committer: Shad Storhaug Committed: Sun Sep 10 21:10:55 2017 +0700 ---------------------------------------------------------------------- build/build.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c02a98da/build/build.ps1 ---------------------------------------------------------------------- diff --git a/build/build.ps1 b/build/build.ps1 index ad0ca63..c303a01 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -72,14 +72,20 @@ task InstallSDK -description "This task makes sure the correct SDK version is in if (!$sdkVersion.Equals("1.0.4")) { Write-Host "Require SDK version 1.0.4, installing..." -ForegroundColor Red #Install the correct version of the .NET SDK for this build - Invoke-Expression "$base_directory\build\dotnet-install.ps1 -Version 1.0.4" + $success = Invoke-Expression "$base_directory\build\dotnet-install.ps1 -Version 1.0.5;$?" + if (-not $success) { + throw "The .NET Core 1.0.4 SDK failed to install." + } } # Make sure framework for .NET Core 2.0.0 is available if (!$sdkVersion.Equals("2.0.0")) { Write-Host "Require SDK version 2.0.0, installing..." -ForegroundColor Red #Install the correct version of the .NET SDK for this build - Invoke-Expression "$base_directory\build\dotnet-install.ps1 -Version 2.0.0" + $success = Invoke-Expression "$base_directory\build\dotnet-install.ps1 -Version 2.0.0;$?" + if (-not $success) { + throw "The .NET Core 2.0.0 SDK failed to install." + } } # Safety check - this should never happen