Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC497D6FA for ; Wed, 22 May 2013 06:51:04 +0000 (UTC) Received: (qmail 86508 invoked by uid 500); 22 May 2013 06:51:05 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 86151 invoked by uid 500); 22 May 2013 06:51:04 -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 85437 invoked by uid 99); 22 May 2013 06:51:00 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 May 2013 06:51:00 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 7E692892B15; Wed, 22 May 2013 06:50:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aharui@apache.org To: commits@flex.apache.org Date: Wed, 22 May 2013 06:51:00 -0000 Message-Id: In-Reply-To: <86f4fcd6a6fc4527aa1f068bcf06b5d1@git.apache.org> References: <86f4fcd6a6fc4527aa1f068bcf06b5d1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/6] git commit: [flex-sdk] [refs/heads/develop] - MustellaTestChooser now can be used in a script MustellaTestChooser now can be used in a script Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/4e5eed3d Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/4e5eed3d Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/4e5eed3d Branch: refs/heads/develop Commit: 4e5eed3d8b4691ffbf048a6dbdab70cbc272e2dd Parents: 9e3f36f Author: Alex Harui Authored: Tue May 21 16:57:39 2013 -0700 Committer: Alex Harui Committed: Tue May 21 23:50:40 2013 -0700 ---------------------------------------------------------------------- .../src/MustellaTestChooser.mxml | 40 ++++++++++++++- 1 files changed, 39 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4e5eed3d/mustella/utilities/MustellaTestChooser/src/MustellaTestChooser.mxml ---------------------------------------------------------------------- diff --git a/mustella/utilities/MustellaTestChooser/src/MustellaTestChooser.mxml b/mustella/utilities/MustellaTestChooser/src/MustellaTestChooser.mxml index 38c2ec5..e682c38 100644 --- a/mustella/utilities/MustellaTestChooser/src/MustellaTestChooser.mxml +++ b/mustella/utilities/MustellaTestChooser/src/MustellaTestChooser.mxml @@ -19,7 +19,8 @@ limitations under the License. --> + xmlns:mx="library://ns.adobe.com/flex/mx" + invoke="checkArgs(event)"> @@ -28,6 +29,43 @@ limitations under the License. private var dirFile:File = new File(); private var fs:FileStream; + private function checkArgs(event:InvokeEvent):void + { + var args:Array = event.arguments; + if (args.length > 0 && args[0].indexOf("-file") > -1) + { + var wd:File = event.currentDirectory; + var flexDir:String = wd.nativePath; + var c:int = flexDir.indexOf(File.separator + "utilities"); + if (c != -1) + { + flexDir = flexDir.substr(0, c); + } + dirFile.nativePath = dir.text = flexDir; + callLater(autoStep2, [flexDir]); + } + } + + private function autoStep2(flexDir:String):void + { + var gs:File = new File(flexDir + File.separator + ".." + File.separator + "gitstatus.txt"); + fs = new FileStream(); + fs.open(gs, FileMode.READ); + statusLog.text = fs.readUTFBytes(fs.bytesAvailable); + fs.close(); + callLater(autoStep3); + } + + private function autoStep3():void + { + computeTests(); + callLater(autoStep4); + } + + private function autoStep4():void + { + this.nativeApplication.exit(); + } private function browse():void { dirFile.addEventListener(Event.SELECT, selectHandler);