You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/05/22 08:51:00 UTC
[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 <ah...@apache.org>
Authored: Tue May 21 16:57:39 2013 -0700
Committer: Alex Harui <ah...@apache.org>
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.
-->
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
- xmlns:mx="library://ns.adobe.com/flex/mx">
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ invoke="checkArgs(event)">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
@@ -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);