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 8AB1C200C68 for ; Tue, 18 Apr 2017 14:15:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8956D160BA1; Tue, 18 Apr 2017 12:15:09 +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 CBC18160BB2 for ; Tue, 18 Apr 2017 14:15:08 +0200 (CEST) Received: (qmail 94359 invoked by uid 500); 18 Apr 2017 12:15:07 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 94276 invoked by uid 99); 18 Apr 2017 12:15:07 -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; Tue, 18 Apr 2017 12:15:07 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A488EE04AA; Tue, 18 Apr 2017 12:15:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cdutz@apache.org To: commits@flex.apache.org Date: Tue, 18 Apr 2017 12:15:11 -0000 Message-Id: <0360cdc9c1ec4c6b85b191946b259959@git.apache.org> In-Reply-To: <243a5207b1b5439fa217be86c93104d8@git.apache.org> References: <243a5207b1b5439fa217be86c93104d8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [05/15] git commit: [flex-utilities] [refs/heads/feature/flash-downloader] - ant_on_air: Exec task makes Ant fail if failonerror is true and the NativeProcessExitEvent exitCode is not 0 archived-at: Tue, 18 Apr 2017 12:15:09 -0000 ant_on_air: Exec task makes Ant fail if failonerror is true and the NativeProcessExitEvent exitCode is not 0 Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/903fddec Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/903fddec Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/903fddec Branch: refs/heads/feature/flash-downloader Commit: 903fddecda2c30e6069db5763baec51dca5a82c7 Parents: 60b0452 Author: Josh Tynjala Authored: Mon Nov 21 14:35:44 2016 -0800 Committer: Josh Tynjala Committed: Mon Nov 21 14:35:44 2016 -0800 ---------------------------------------------------------------------- .../ant_on_air/src/org/apache/flex/ant/tags/Exec.as | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/903fddec/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/Exec.as ---------------------------------------------------------------------- diff --git a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/Exec.as b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/Exec.as index bc503a6..e5eced7 100644 --- a/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/Exec.as +++ b/flex-installer/ant_on_air/src/org/apache/flex/ant/tags/Exec.as @@ -126,11 +126,23 @@ package org.apache.flex.ant.tags { return getAttributeValue("@outputproperty"); } + + override public function get failonerror():Boolean + { + var val:String = getNullOrAttributeValue("@failonerror"); + //if omitted, defaults to false + return val == null ? false : val == "true"; + } private var process:NativeProcess; private function exitHandler(event:NativeProcessExitEvent):void { + if(event.exitCode !== 0 && failonerror) + { + ant.project.failureMessage = "Exec task failed: " + fileName; + ant.project.status = false; + } dispatchEvent(new Event(Event.COMPLETE)); }