flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [01/48] git commit: [flex-utilities] [refs/heads/develop] - move ant_on_air into flex-installer
Date Mon, 15 Jun 2015 06:30:35 GMT
Repository: flex-utilities
Updated Branches:
  refs/heads/develop aaf8896ae -> 657a7defe


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/AntOnAir.mxml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/AntOnAir.mxml b/flex-installer/ant_on_air/tests/AntOnAir.mxml
new file mode 100644
index 0000000..af19555
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/AntOnAir.mxml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
+                   xmlns:local="*"
+                   xmlns:mx="library://ns.adobe.com/flex/mx"
+                   xmlns:s="library://ns.adobe.com/flex/spark" 
+                   invoke="checkargs(event)"
+                   >
+    <fx:Script>
+        <![CDATA[
+            // in theory, all new tags are added to AntClasses.as
+            // and therefore force-linking this should initialize
+            // all tag handlers
+            import AntClasses; AntClasses;
+            import org.apache.flex.ant.Ant;
+            import org.apache.flex.ant.tags.Copy;
+            import org.apache.flex.ant.tags.Get;
+            import org.apache.flex.ant.tags.Checksum;
+            
+            private function checkargs(event:InvokeEvent):void
+            {
+				var targets:Array = [];
+
+				var nextIsAntFile:Boolean;
+				
+                for each (var s:String in event.arguments)
+				{
+					if (s == "-f")
+					{
+						nextIsAntFile = true;
+					}
+					else if (nextIsAntFile)
+					{
+						nextIsAntFile = false;
+						antfilename = s;
+					}
+					else if (s.indexOf("-f ") != -1)
+					{
+						antfilename = s.substr(3);
+					}
+					else if (s.indexOf("-D") != -1)
+					{
+						s = s.substr(2);
+						var c:int = s.indexOf("=");
+						if (c != -1)
+						{
+							var parts:Array = s.split("=");
+							context[parts[0]] = parts[1];
+						}
+						else
+							context[s] = true;
+					}
+					else
+						targets.push(s);
+				}
+				context.targets = targets.join(",");
+                test();
+            }
+            
+			private var context:Object = {};
+			
+			private var antfilename:String = "build.xml";
+			
+            public function test():void
+            {
+                ant = new Ant();
+                ant.output = output;
+                var file:File = File.applicationDirectory;
+                file = file.resolvePath(antfilename);
+                addEventListener(Event.ENTER_FRAME, enterFrameHandler);
+                if (!ant.processXMLFile(file, context, true))
+                {
+                    ant.addEventListener(Event.COMPLETE, completeHandler);
+                    ant.addEventListener(ProgressEvent.PROGRESS, progressEventHandler);
+                    // redispatch keyboard events off of ant so input task can see them
+                    systemManager.stage.addEventListener(KeyboardEvent.KEY_DOWN, ant_keyDownHandler);
+                    pb.source = ant;
+                }
+                else
+                    completeHandler(null);
+            }
+            
+            private function progressEventHandler(event:ProgressEvent):void
+            {
+                if (ant.progressClass is Copy)
+                {
+                    pb.label = "Copying %1 of %2";
+                }
+                else if (ant.progressClass is Get)
+                {
+                    pb.label = "Downloading bytes %1 of %2";                    
+                }
+                else if (ant.progressClass is Checksum)
+                {
+                    pb.label = "Computing checksum: bytes %1 of %2";                    
+                }
+            }
+            
+            private function completeHandler(event:Event):void
+            {
+                var failureMode:Boolean = context.expectfailure;
+                var msg:String = Ant.currentAnt.project.failureMessage;
+                
+                if (failureMode && !Ant.currentAnt.project.status)
+                    output(msg ? msg : "no failure message provided");
+                
+                if (Ant.currentAnt.project.status)
+                    output(failureMode ? "FAILURE" : "SUCCESS!");
+                else
+                    output(failureMode ? "SUCCESS" : "FAILURE!");
+                
+                var successCode:int = failureMode ? 255 : 0;
+                var failureCode:int = failureMode ? 0 : 255;
+                
+                if (context.exitwhendone)
+                    NativeApplication.nativeApplication.exit(Ant.currentAnt.project.status ? successCode : failureCode);
+            }
+            
+            private var ant:Ant;
+            
+            private function output(s:String):void
+            {
+                console.text += s + "\n";
+                callLater(scrollConsoleToBottom);
+            }
+            
+            private function scrollConsoleToBottom():void
+            {
+                console.verticalScrollPosition = console.maxVerticalScrollPosition;
+            }
+            
+            private function enterFrameHandler(event:Event):void
+            {
+                ant.doCallback();
+            }
+            
+            private function ant_keyDownHandler(event:KeyboardEvent):void
+            {
+                ant.dispatchEvent(event);
+            }
+        ]]>
+    </fx:Script>
+    <s:layout>
+        <s:VerticalLayout />
+    </s:layout>
+    <mx:TextArea id="console" width="100%" height="100%" fontFamily="Courier New" />
+    <mx:ProgressBar id="pb" width="100%" mode="event" label="" />
+</s:WindowedApplication>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/TestTarget-app.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/TestTarget-app.xml b/flex-installer/ant_on_air/tests/TestTarget-app.xml
new file mode 100644
index 0000000..2cb5795
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/TestTarget-app.xml
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+<application xmlns="http://ns.adobe.com/air/application/3.4">
+
+<!-- Adobe AIR Application Descriptor File Template.
+
+	Specifies parameters for identifying, installing, and launching AIR applications.
+
+	xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/3.1
+			The last segment of the namespace specifies the version 
+			of the AIR runtime required for this application to run.
+			
+	minimumPatchLevel - The minimum patch level of the AIR runtime required to run 
+			the application. Optional.
+-->
+
+	<!-- A universally unique application identifier. Must be unique across all AIR applications.
+	Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
+	<id>TestTarget</id>
+
+	<!-- Used as the filename for the application. Required. -->
+	<filename>TestTarget</filename>
+
+	<!-- The name that is displayed in the AIR application installer. 
+	May have multiple values for each language. See samples or xsd schema file. Optional. -->
+	<name>TestTarget</name>
+	
+	<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade. 
+	Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
+	An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5 . -->
+	<versionNumber>0.0.0</versionNumber>
+		         
+	<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
+	<!-- <versionLabel></versionLabel> -->
+
+	<!-- Description, displayed in the AIR application installer.
+	May have multiple values for each language. See samples or xsd schema file. Optional. -->
+	<!-- <description></description> -->
+
+	<!-- Copyright information. Optional -->
+	<!-- <copyright></copyright> -->
+
+	<!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
+	<!-- <publisherID></publisherID> -->
+
+	<!-- Settings for the application's initial window. Required. -->
+	<initialWindow>
+		<!-- The main SWF or HTML file of the application. Required. -->
+		<!-- Note: In Flash Builder, the SWF reference is set automatically. -->
+		<content>TestTarget.swf</content>
+		
+		<!-- The title of the main window. Optional. -->
+		<!-- <title></title> -->
+
+		<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
+		<!-- <systemChrome></systemChrome> -->
+
+		<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
+		<!-- <transparent></transparent> -->
+
+		<!-- Whether the window is initially visible. Optional. Default false. -->
+		<!-- <visible></visible> -->
+
+		<!-- Whether the user can minimize the window. Optional. Default true. -->
+		<!-- <minimizable></minimizable> -->
+
+		<!-- Whether the user can maximize the window. Optional. Default true. -->
+		<!-- <maximizable></maximizable> -->
+
+		<!-- Whether the user can resize the window. Optional. Default true. -->
+		<!-- <resizable></resizable> -->
+
+		<!-- The window's initial width in pixels. Optional. -->
+		<!-- <width></width> -->
+
+		<!-- The window's initial height in pixels. Optional. -->
+		<!-- <height></height> -->
+
+		<!-- The window's initial x position. Optional. -->
+		<!-- <x></x> -->
+
+		<!-- The window's initial y position. Optional. -->
+		<!-- <y></y> -->
+
+		<!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
+		<!-- <minSize></minSize> -->
+
+		<!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
+		<!-- <maxSize></maxSize> -->
+
+        <!-- The initial aspect ratio of the app when launched (either "portrait" or "landscape"). Optional. Mobile only. Default is the natural orientation of the device -->
+
+        <!-- <aspectRatio></aspectRatio> -->
+
+        <!-- Whether the app will begin auto-orienting on launch. Optional. Mobile only. Default false -->
+
+        <!-- <autoOrients></autoOrients> -->
+
+        <!-- Whether the app launches in full screen. Optional. Mobile only. Default false -->
+
+        <!-- <fullScreen></fullScreen> -->
+
+        <!-- The render mode for the app (either auto, cpu, gpu, or direct). Optional. Default auto -->
+
+        <!-- <renderMode></renderMode> -->
+
+		<!-- Whether or not to pan when a soft keyboard is raised or lowered (either "pan" or "none").  Optional.  Defaults "pan." -->
+		<!-- <softKeyboardBehavior></softKeyboardBehavior> -->
+	<autoOrients>false</autoOrients>
+        <fullScreen>false</fullScreen>
+        <visible>false</visible>
+    </initialWindow>
+
+	<!-- We recommend omitting the supportedProfiles element, -->
+	<!-- which in turn permits your application to be deployed to all -->
+	<!-- devices supported by AIR. If you wish to restrict deployment -->
+	<!-- (i.e., to only mobile devices) then add this element and list -->
+	<!-- only the profiles which your application does support. -->
+	<!-- <supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles> -->
+	<supportedProfiles>extendedDesktop</supportedProfiles> -->
+
+	<!-- The subpath of the standard default installation location to use. Optional. -->
+	<!-- <installFolder></installFolder> -->
+
+	<!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
+	<!-- <programMenuFolder></programMenuFolder> -->
+
+	<!-- The icon the system uses for the application. For at least one resolution,
+	specify the path to a PNG file included in the AIR package. Optional. -->
+	<!-- <icon>
+		<image16x16></image16x16>
+		<image32x32></image32x32>
+		<image36x36></image36x36>
+		<image48x48></image48x48>
+		<image57x57></image57x57>
+		<image72x72></image72x72>
+		<image114x114></image114x114>
+		<image128x128></image128x128>
+	</icon> -->
+
+	<!-- Whether the application handles the update when a user double-clicks an update version
+	of the AIR file (true), or the default AIR application installer handles the update (false).
+	Optional. Default false. -->
+	<!-- <customUpdateUI></customUpdateUI> -->
+	
+	<!-- Whether the application can be launched when the user clicks a link in a web browser.
+	Optional. Default false. -->
+	<!-- <allowBrowserInvocation></allowBrowserInvocation> -->
+
+	<!-- Listing of file types for which the application can register. Optional. -->
+	<!-- <fileTypes> -->
+
+		<!-- Defines one file type. Optional. -->
+		<!-- <fileType> -->
+
+			<!-- The name that the system displays for the registered file type. Required. -->
+			<!-- <name></name> -->
+
+			<!-- The extension to register. Required. -->
+			<!-- <extension></extension> -->
+			
+			<!-- The description of the file type. Optional. -->
+			<!-- <description></description> -->
+			
+			<!-- The MIME content type. -->
+			<!-- <contentType></contentType> -->
+			
+			<!-- The icon to display for the file type. Optional. -->
+			<!-- <icon>
+				<image16x16></image16x16>
+				<image32x32></image32x32>
+				<image48x48></image48x48>
+				<image128x128></image128x128>
+			</icon> -->
+			
+		<!-- </fileType> -->
+	<!-- </fileTypes> -->
+
+    <!-- iOS specific capabilities -->
+	<!-- <iPhone> -->
+		<!-- A list of plist key/value pairs to be added to the application Info.plist -->
+		<!-- <InfoAdditions>
+            <![CDATA[
+                <key>UIDeviceFamily</key>
+                <array>
+                    <string>1</string>
+                    <string>2</string>
+                </array>
+                <key>UIStatusBarStyle</key>
+                <string>UIStatusBarStyleBlackOpaque</string>
+                <key>UIRequiresPersistentWiFi</key>
+                <string>YES</string>
+            ]]>
+        </InfoAdditions> -->
+        <!-- A list of plist key/value pairs to be added to the application Entitlements.plist -->
+		<!-- <Entitlements>
+            <![CDATA[
+                <key>keychain-access-groups</key>
+                <array>
+                    <string></string>
+                    <string></string>
+                </array>
+            ]]>
+        </Entitlements> -->
+	<!-- Display Resolution for the app (either "standard" or "high"). Optional. Default "standard" -->
+	<!-- <requestedDisplayResolution></requestedDisplayResolution> -->
+	<!-- </iPhone> -->
+
+	<!-- Specify Android specific tags that get passed to AndroidManifest.xml file. -->
+    <!--<android> -->
+    <!--	<manifestAdditions>
+		<![CDATA[
+			<manifest android:installLocation="auto">
+				<uses-permission android:name="android.permission.INTERNET"/>
+				<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+				<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+				<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
+				<application android:enabled="true">
+					<activity android:excludeFromRecents="false">
+						<intent-filter>
+							<action android:name="android.intent.action.MAIN"/>
+							<category android:name="android.intent.category.LAUNCHER"/>
+						</intent-filter>
+					</activity>
+				</application>
+            </manifest>
+		]]>
+        </manifestAdditions> -->
+	    <!-- Color depth for the app (either "32bit" or "16bit"). Optional. Default 16bit before namespace 3.0, 32bit after -->
+        <!-- <colorDepth></colorDepth> -->
+    <!-- </android> -->
+	<!-- End of the schema for adding the android specific tags in AndroidManifest.xml file -->
+
+</application>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/TestTarget.as
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/TestTarget.as b/flex-installer/ant_on_air/tests/TestTarget.as
new file mode 100644
index 0000000..287d13a
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/TestTarget.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+    import flash.desktop.NativeApplication;
+    import flash.display.Sprite;
+    import flash.events.Event;
+    import flash.filesystem.File;
+    import org.apache.flex.ant.Ant;
+    import org.apache.flex.ant.tags.Available; Available.init(null);
+    import org.apache.flex.ant.tags.Condition; Condition.init(null);
+    import org.apache.flex.ant.tags.Copy; Copy.init(null);
+    import org.apache.flex.ant.tags.Delete; Delete.init(null);
+    import org.apache.flex.ant.tags.Echo; Echo.init(null);
+    import org.apache.flex.ant.tags.Fail; Fail.init(null);
+    import org.apache.flex.ant.tags.FileSet; FileSet.init(null);
+    import org.apache.flex.ant.tags.FileSetExclude; FileSetExclude.init(null);
+    import org.apache.flex.ant.tags.FileSetInclude; FileSetInclude.init(null);
+    import org.apache.flex.ant.tags.IsSet; IsSet.init(null);
+    import org.apache.flex.ant.tags.Mkdir; Mkdir.init(null);
+    import org.apache.flex.ant.tags.Not; Not.init(null);
+    import org.apache.flex.ant.tags.OS; OS.init(null);
+    import org.apache.flex.ant.tags.Project; Project.init(null);
+    import org.apache.flex.ant.tags.Property; Property.init(null);
+    import org.apache.flex.ant.tags.Target; Target.init(null);
+    
+    public class TestTarget extends Sprite
+    {
+        public function TestTarget()
+        {
+            ant = new Ant();
+            var context:Object = { targets: "test" };
+            var file:File = File.applicationDirectory;
+            file = file.resolvePath("test.xml");
+            if (!ant.processXMLFile(file, context, false))
+                ant.addEventListener(Event.COMPLETE, completeHandler);
+            else
+                completeHandler(null);
+        }
+        
+        private function completeHandler(event:Event):void
+        {
+            if (Ant.project.status)
+                trace("SUCCESS!");
+            else
+                trace("FAILURE!");
+            NativeApplication.nativeApplication.exit();
+        }
+        
+        private var ant:Ant;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/copyfilesetofone.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/copyfilesetofone.xml b/flex-installer/ant_on_air/tests/copyfilesetofone.xml
new file mode 100644
index 0000000..e4d1c9d
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/copyfilesetofone.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="ant_on_air_copy_fileset_of_one" basedir="." default="test">
+
+    <property name="closure.name" value="compiler" />
+    <property name="lib.dir" value="/Users/aharui/Work/apache-flex-flexjs-4.0.1-bin/js/lib" />
+    <property name="download.dir" value="/Users/aharui/Work/apache-flex-flexjs-4.0.1-bin/in" />
+    
+	<target name="test" >
+	    <copy todir="${lib.dir}/google/closure-compiler">
+	        <fileset dir="${download.dir}/temp">
+	            <include name="${closure.name}.jar"/>
+	        </fileset>
+	    </copy>
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/failsubant.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/failsubant.xml b/flex-installer/ant_on_air/tests/failsubant.xml
new file mode 100644
index 0000000..2e09bfb
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/failsubant.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="ant_on_air_test_subant_fail" basedir="." default="subant">
+
+    <!--load environment variables prefixed with env -->
+    <property environment="env"/>
+
+    <!--location of property file -->
+    <property file="${basedir}/../build.properties" description="Properties for Ant On AIR project" />
+
+    <!--
+        Properties are immutable so value frozen first time property is set.
+        If FLEX_HOME is not set with -DFLEX_HOME=/path/to/flex/sdk on the ant command line
+        use the environment variable, if it exists. Else if windows, use FLEX_HOME_WIN
+        else use FLEX_HOME_MAC, which are both defined in build.properties.
+    -->
+    <condition property="FLEX_HOME" value="${env.FLEX_HOME}">
+        <isset property="env.FLEX_HOME" />
+    </condition>
+
+	<target name="subant">
+        <fail message="This is a failure message." >
+            <condition>
+                <not>
+                    <equals arg1="success" arg2="failure" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+        
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/failtest.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/failtest.xml b/flex-installer/ant_on_air/tests/failtest.xml
new file mode 100644
index 0000000..74f0dcb
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/failtest.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="ant_on_air_failure_test" basedir="." default="test">
+
+    <!--load environment variables prefixed with env -->
+    <property environment="env"/>
+
+    <!--location of property file -->
+    <property file="${basedir}/../build.properties" description="Properties for Ant On AIR project" />
+
+    <!--
+        Properties are immutable so value frozen first time property is set.
+        If FLEX_HOME is not set with -DFLEX_HOME=/path/to/flex/sdk on the ant command line
+        use the environment variable, if it exists. Else if windows, use FLEX_HOME_WIN
+        else use FLEX_HOME_MAC, which are both defined in build.properties.
+    -->
+    <condition property="FLEX_HOME" value="${env.FLEX_HOME}">
+        <isset property="env.FLEX_HOME" />
+    </condition>
+
+    <condition property="theOS" value="Windows">
+		<os family="windows"/>
+    </condition>
+    <condition property="theOS" value="Mac">
+		<os family="mac"/>
+    </condition>
+    <condition property="isMac" value="Mac">
+		<os family="mac"/>
+    </condition>
+    <condition property="isWindows" value="Windows">
+		<os family="windows"/>
+    </condition>
+
+	<target name="test">
+        <ant dir="${basedir}" antfile="failsubant.xml" />
+        <echo>Test is complete</echo>
+    </target>
+    
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/freespace.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/freespace.xml b/flex-installer/ant_on_air/tests/freespace.xml
new file mode 100644
index 0000000..51443bd
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/freespace.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="freespace" basedir="." default="test">
+
+	<condition property="partition" value="c:">
+        <os family="windows"/>
+    </condition>
+	<property name="partition" value="/" />
+	
+    <target name="test">
+		<!-- likely to be true -->
+	    <condition property="just_right" value="success">
+	    	<and>
+	    		<hasfreespace partition="${partition}" needed="1K" />
+	    		<hasfreespace partition="${partition}" needed="10K" />
+	    		<hasfreespace partition="${partition}" needed="100K" />
+	    		<hasfreespace partition="${partition}" needed="1M" />
+	    		<hasfreespace partition="${partition}" needed="10M" />
+	    		<hasfreespace partition="${partition}" needed="100M" />
+	    		<hasfreespace partition="${partition}" needed="1G" />
+	    	</and>
+	    </condition>
+	    		
+	    <echo>Has free space: ${just_right} should be 'success'</echo>
+	    <fail message="and test 1 failed" >
+	        <condition>
+	            <not>
+	                <equals arg1="success" arg2="${just_right}" />
+	            </not>
+	        </condition>
+	    </fail>
+	    		
+		<!-- likely to be true -->
+	    <condition property="too_big" value="success">
+	    	<and>
+	    		<hasfreespace partition="${partition}" needed="1G" />
+	    		<hasfreespace partition="${partition}" needed="10G" />
+	    		<hasfreespace partition="${partition}" needed="100G" />
+	    		<hasfreespace partition="${partition}" needed="1T" />
+	    		<hasfreespace partition="${partition}" needed="10T" />
+	    		<hasfreespace partition="${partition}" needed="100T" />
+	    		<hasfreespace partition="${partition}" needed="1P" />
+	    	</and>
+	    </condition>
+	    	
+	    <echo>Far too big: ${too_big} should be not be 'success'</echo>
+	    <fail message="and test 2 failed" >
+	        <condition>
+	            <equals arg1="success" arg2="${too_big}" />
+	        </condition>
+	    </fail>
+	</target>
+</project>
+    	    		

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/mirrortest.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/mirrortest.xml b/flex-installer/ant_on_air/tests/mirrortest.xml
new file mode 100644
index 0000000..7966029
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/mirrortest.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="mirrortest" basedir="." default="test">
+
+    <property name="pixelbender.url" value="http://archive.apache.org/dist" />
+<!--
+    <property name="pixelbender.url" value="http://www.apache.org/dyn/mirrors/mirrors.cgi" />
+-->
+    <property name="pixelbender.folder" value="flex/pixelbender/1.0/binaries" />
+    <property name="pixelbender.bin.zip" value="apache-flex-sdk-pixel-bender-1.0.0-bin.zip" />
+    
+    
+	<target name="test">
+        <antcall target="get_from_mirror" >
+            <param name="server" value="${pixelbender.url}" />
+            <param name="folder" value="${pixelbender.folder}" />
+            <param name="file" value="${pixelbender.bin.zip}" />
+            <param name="dest" value="${basedir}/${pixelbender.bin.zip}" />
+        </antcall>
+    </target>
+    
+    <target name="get_from_mirror">
+        <condition property="usingmirror" value="true">
+            <contains string="${server}" substring="mirrors.cgi" />
+        </condition>
+        <antcall target="download_using_mirror">
+            <param name="server" value="${server}" />
+            <param name="folder" value="${folder}" />
+            <param name="file" value="${file}" />
+            <param name="dest" value="${dest}" />
+        </antcall>
+        <antcall target="download_using_get">
+            <param name="server" value="${server}" />
+            <param name="folder" value="${folder}" />
+            <param name="file" value="${file}" />
+            <param name="dest" value="${dest}" />
+        </antcall>
+    </target>
+
+    <target name="download_using_mirror" if="usingmirror">
+        <get src="${server}/${folder}/${file}?asjson=true" verbose="true" dest="${basedir}/mirror.json" />
+        <replace file="${basedir}/mirror.json">
+            <replacefilter token="&quot;"
+            value="" />
+            <replacefilter token=": "
+            value="=" />
+        </replace>
+        <property file="${basedir}/mirror.json" />
+        <delete file="${basedir}/mirror.json" />
+        <echo>Using mirror: ${preferred}</echo>
+        <get src="${preferred}${folder}/${file}" dest="${dest}" />
+    </target>
+    
+    <target name="download_using_get" unless="usingmirror">
+        <get src="${server}/${folder}/${file}" dest="${dest}" />
+    </target>
+    
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/redirect.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/redirect.xml b/flex-installer/ant_on_air/tests/redirect.xml
new file mode 100644
index 0000000..e5512bc
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/redirect.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="ant_on_air_redirect" basedir="." default="test">
+
+	<target name="test" >
+        <get src="http://downloads.sourceforge.net/project/jburg/jburg-1.10.1.tar.gz"
+            dest="${basedir}" />
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/subant.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/subant.xml b/flex-installer/ant_on_air/tests/subant.xml
new file mode 100644
index 0000000..4174c1f
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/subant.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="ant_on_air_test_subant" basedir="." default="subant">
+
+    <!--load environment variables prefixed with env -->
+    <property environment="env"/>
+
+    <!--location of property file -->
+    <property file="${basedir}/../build.properties" description="Properties for Ant On AIR project" />
+
+    <!--
+        Properties are immutable so value frozen first time property is set.
+        If FLEX_HOME is not set with -DFLEX_HOME=/path/to/flex/sdk on the ant command line
+        use the environment variable, if it exists. Else if windows, use FLEX_HOME_WIN
+        else use FLEX_HOME_MAC, which are both defined in build.properties.
+    -->
+    <condition property="FLEX_HOME" value="${env.FLEX_HOME}">
+        <isset property="env.FLEX_HOME" />
+    </condition>
+
+    <condition property="theOS" value="Windows">
+		<os family="windows"/>
+    </condition>
+    <condition property="theOS" value="Mac">
+		<os family="mac"/>
+    </condition>
+    <condition property="isMac" value="Mac">
+		<os family="mac"/>
+    </condition>
+
+    <condition property="and_success" value="success" >
+        <and>
+            <matches string="foobar" pattern=".*bar" />
+            <isset property="env.FLEX_HOME" />
+        </and>
+    </condition>
+	
+    <condition property="and_failure" value="success" >
+        <and>
+            <matches string="foobar" pattern=".*bar" />
+            <isset property="env.NONEXISTANT" />
+        </and>
+    </condition>
+	
+    <condition property="or_success" value="success" >
+        <or>
+            <matches string="foobar" pattern=".*bar" />
+            <isset property="env.NONEXISTANT" />
+        </or>
+    </condition>
+	
+    <condition property="or_failure" value="success" >
+        <or>
+            <matches string="foobar" pattern=".*fred" />
+            <isset property="env.NONEXISTANT" />
+        </or>
+    </condition>
+
+    <condition property="should_fail" value="success" >
+        <and>
+            <matches string="foobar" pattern=".*bar" />
+            <not>
+                <isset property="env.FLEX_HOME" />
+            </not>
+        </and>
+    </condition>
+
+	<target name="subant">
+        <antcall target="paramtest">
+            <param name="foo" value="bar" />
+        </antcall>
+        <echo>subant reported 'and' test 1: ${and_success} should be 'success'</echo>
+        <fail message="and test 1 failed" >
+            <condition>
+                <not>
+                    <equals arg1="success" arg2="${and_success}" />
+                </not>
+            </condition>
+        </fail>
+		<echo>subant reported 'or' test 2: ${or_success} should be 'success'</echo>
+        <fail message="and test 2 failed" >
+            <condition>
+                <not>
+                    <equals arg1="success" arg2="${or_success}" />
+                </not>
+            </condition>
+        </fail>
+		<echo>subant reported 'and' test 3: ${and_failure} should not be 'success'</echo>
+        <fail message="and test 3 failed" >
+            <condition>
+            	<equals arg1="success" arg2="${and_failure}" />
+            </condition>
+        </fail>
+		<echo>subant reported 'or' test 4: ${or_failure} should not be 'success'</echo>
+        <fail message="and test 4 failed" >
+            <condition>
+                <equals arg1="success" arg2="${or_failure}" />
+            </condition>
+        </fail>
+        <echo>subant reported 'isset' test 5: ${should_fail} should not be defined</echo>
+        <fail message="and test 5 failed" >
+            <condition>
+                <equals arg1="success" arg2="${should_fail}" />
+            </condition>
+        </fail>
+    </target>
+    
+    <target name="paramtest">
+        <echo>paramtest said ${foo} should say bar</echo>
+    </target>
+    
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/test.properties
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/test.properties b/flex-installer/ant_on_air/tests/test.properties
new file mode 100644
index 0000000..5c1893f
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/test.properties
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+test1=basedir
+test2=${basedir}
+test3=$${basedir}
+test4=Foo is $${basedir}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/test.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/test.xml b/flex-installer/ant_on_air/tests/test.xml
new file mode 100644
index 0000000..e218795
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/test.xml
@@ -0,0 +1,389 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="ant_on_air_test" basedir="." default="build">
+
+    <!--load environment variables prefixed with env -->
+    <property environment="env"/>
+
+    <!--location of property file -->
+    <property file="${basedir}/../build.properties" description="Properties for Ant On AIR project" />
+
+    <!--
+        Properties are immutable so value frozen first time property is set.
+        If FLEX_HOME is not set with -DFLEX_HOME=/path/to/flex/sdk on the ant command line
+        use the environment variable, if it exists. Else if windows, use FLEX_HOME_WIN
+        else use FLEX_HOME_MAC, which are both defined in build.properties.
+    -->
+    <condition property="FLEX_HOME" value="${env.FLEX_HOME}">
+        <isset property="env.FLEX_HOME" />
+    </condition>
+
+    <condition property="theOS" value="Windows">
+		<os family="windows"/>
+    </condition>
+    <condition property="theOS" value="Mac">
+		<os family="mac"/>
+    </condition>
+    <condition property="isMac" value="Mac">
+		<os family="mac"/>
+    </condition>
+    <condition property="isWindows" value="Windows">
+		<os family="windows"/>
+    </condition>
+
+	<target name="test" depends="copy-test,confirm-delete,delete-test,freespace-test,true-false-test">
+        <tstamp />
+        <echo>${DSTAMP}</echo>
+        <echo>${TSTAMP}</echo>
+        <echo>${TODAY}</echo>
+        <exec executable="where.exe" osfamily="windows" outputproperty="java.executable" failonerror="true">
+            <arg value="java"/>
+        </exec>
+        <exec executable="which" osfamily="mac" outputproperty="java.executable" failonerror="true">
+            <arg value="java"/>
+        </exec>
+        <echo>java is at ${java.executable}</echo>
+        <ant dir="${basedir}" antfile="subant.xml" />
+        <echo>Test is complete</echo>
+    </target>
+    
+    <target name="copy-test">
+		<echo>FLEX_HOME is ${FLEX_HOME}. DEBUG is ${DEBUG_FLAG}. The OS is ${theOS}</echo>
+        <mkdir dir="${basedir}/temp" />
+        <copy file="${basedir}/test.xml" tofile="${basedir}/temp/copied.xml" />
+        <available file="${basedir}/temp/copied.xml" property="copied.doesnt.exist" value="got copied" />
+        <fail message="test.xml was not copied to temp/copied.xml">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/copied.xml" />
+                </not>
+            </condition>
+        </fail>
+        <echo>copied ${copied.doesnt.exist}.  Should say: got copied</echo>
+        <move file="${basedir}/temp/copied.xml" toFile="${basedir}/temp/moved.xml" />
+        <available file="${basedir}/temp/moved.xml" property="moved.doesnt.exist" value="got moved" />
+        <fail message="copied.xml was not moved to temp/moved.xml">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/moved.xml" />
+                </not>
+            </condition>
+        </fail>
+        <echo>moved ${moved.doesnt.exist}.  Should say: got moved</echo>
+        <copy todir="${basedir}/temp">
+            <fileset dir="${basedir}/../src">
+                <include name="**/**" />
+                <exclude name="**/Ant.as" />
+            </fileset>
+            <globmapper from="*" to="Z*" />
+        </copy>
+        <available file="${basedir}/temp/Zorg/apache/flex/ant/Ant.as" property="ant.doesnt.exist" value="got copied" />
+        <fail message="Ant.as was copied to temp">
+            <condition>
+                <available file="${basedir}/temp/Zorg/apache/flex/ant/Ant.as" />
+            </condition>
+        </fail>
+        <echo>Ant.as ${ant.doesnt.exist}. Should NOT say: got copied</echo>
+        <available file="${basedir}/temp/Zorg/apache/flex/ant/tags/Project.as" property="project.doesnt.exist" value="got copied" />
+        <fail message="Project.as was not copied to temp">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/Zorg/apache/flex/ant/tags/Project.as" />
+                </not>
+            </condition>
+        </fail>
+        <echo>Project.as ${project.doesnt.exist}. Should say: got copied</echo>
+        <delete file="${basedir}/temp/moved.xml" />
+        <available file="${basedir}/temp/moved.xml" property="moved.doesnt.exist.after.delete" value="didn't get deleted" />
+        <fail message="temp/moved.xml was not deleted">
+            <condition>
+                <available file="${basedir}/temp/moved.xml" />
+            </condition>
+        </fail>
+        <echo>moved.xml ${moved.doesnt.exist.after.delete}. Should NOT say: didn't get deleted</echo>
+        <get src="http://archive.apache.org/dist/creadur/apache-rat-0.10/apache-rat-0.10-src.zip"
+            dest="${basedir}/temp" />
+        <fail message="apache-rat-0.10-src.zip was not copied to temp">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/apache-rat-0.10-src.zip" />
+                </not>
+            </condition>
+        </fail>
+        <get src="http://archive.apache.org/dist/creadur/apache-rat-0.10/apache-rat-0.10-src.zip.md5"
+            dest="${basedir}/temp" />
+        <fail message="apache-rat-0.10-src.zip.md5 was not copied to temp">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/apache-rat-0.10-src.zip.md5" />
+                </not>
+            </condition>
+        </fail>
+        <checksum file="${basedir}/temp/apache-rat-0.10-src.zip" todir="${basedir}/temp"
+            verifyproperty="rat.md5" />
+        <echo>rat checksum match = ${rat.md5}</echo>
+        <fail message="checksum did not match">
+            <condition>
+                <equals arg1="${rat.md5}" arg2="false" />
+            </condition>
+        </fail>
+        <mkdir dir="${basedir}/temp/unzip" />
+        <unzip src="${basedir}/temp/apache-rat-0.10-src.zip" dest="${basedir}/temp/unzip">
+            <patternset>
+                <include name="apache-rat-0.10/pom.xml" />
+                <include name="apache-rat-0.10/RE*.txt" />
+                <exclude name="apache-rat-0.10/RELEASE_NOTES.txt" />
+            </patternset>
+        </unzip>
+        <fail message="unzip did not exclude expected files">
+            <condition>
+                <available file="${basedir}/temp/unzip/apache-rat-0.10/RELEASE_NOTES.txt" />
+            </condition>
+        </fail>
+        <fail message="unzip did not include expected files">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/unzip/apache-rat-0.10/README.txt" />
+                </not>
+            </condition>
+        </fail>
+        <fail message="unzip did not result in expected files">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/unzip/apache-rat-0.10/pom.xml" />
+                </not>
+            </condition>
+        </fail>
+        <get src="http://archive.apache.org/dist/creadur/apache-rat-0.10/apache-rat-0.10-src.tar.gz"
+        dest="${basedir}/temp" />
+        <fail message="apache-rat-0.10-src.tar.gz was not copied to temp">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/apache-rat-0.10-src.tar.gz" />
+                </not>
+            </condition>
+        </fail>
+        <antcall target="macunzip" />
+        <propertyfile file="${basedir}/temp/custom.properties" >
+            <entry key="somekey" value="somevalue" />
+            <entry key="somekey1" value="somevalue1" />
+            <entry key="looptest" value="foo" />
+            <entry key="xml" value="&lt;test/&gt;" />
+        </propertyfile>
+        <fail message="propertyfile did not result in expected file">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/custom.properties" />
+                </not>
+            </condition>
+        </fail>
+        <replace file="${basedir}/temp/custom.properties" token="somekey" value="replacedkey" />
+        <replace file="${basedir}/temp/custom.properties" token="foo" value="food" />
+        <replace file="${basedir}/temp/custom.properties">
+            <replacefilter token="key" value="ky" />
+        </replace>
+        <replace file="${basedir}/temp/custom.properties">
+            <replacetoken>loop</replacetoken>
+            <replacevalue>lop</replacevalue>
+        </replace>
+        <replace file="${basedir}/temp/custom.properties">
+            <replacetoken><![CDATA[<test/>]]></replacetoken>
+            <replacevalue><![CDATA[<replaced/><test/>]]></replacevalue>
+        </replace>
+        <loadproperties srcFile="${basedir}/temp/custom.properties" />
+        <fail message="replace did not work: found somekey">
+            <condition>
+                <isset property="somekey" />
+            </condition>
+        </fail>
+        <fail message="replace did not work: did not find replacedkey">
+            <condition>
+                <not>
+                    <equals arg1="${replacedky}" arg2="somevalue" />
+                </not>
+            </condition>
+        </fail>
+        <fail message="replace did not work: found looptest">
+            <condition>
+                <isset property="looptest" />
+            </condition>
+        </fail>
+        <fail message="replace did not work: did not find replacedkey1">
+            <condition>
+                <not>
+                    <equals arg1="${replacedky1}" arg2="somevalue1" />
+                </not>
+            </condition>
+        </fail>
+        <fail message="replace did not work: did not find food">
+            <condition>
+                <not>
+                    <equals arg1="${loptest}" arg2="food" />
+                </not>
+            </condition>
+        </fail>
+        <fail message="replace did not work: did not find &lt;replaced/&gt;&lt;test/&gt;">
+            <condition>
+                <not>
+                    <equals arg1="${xml}" arg2="&lt;replaced/&gt;&lt;test/&gt;" />
+                </not>
+            </condition>
+        </fail>
+        <echo file="${basedir}/temp/echotest.properties">echotest=good
+        </echo>
+        <loadproperties srcFile="${basedir}/temp/echotest.properties" />
+        <fail message="echo to file did not work: missing property">
+            <condition>
+                <not>
+                    <isset property="echotest" />
+                </not>
+            </condition>
+        </fail>
+        <touch file="${basedir}/temp/touchtest.txt" />
+        <available file="${basedir}/temp/touchtest.txt" property="touch.test" value="passed" />
+        <fail message="touch test failed">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/touchtest.txt" />
+                </not>
+            </condition>
+        </fail>
+        <echo>Touch test ${touch.test}. Should say: passed</echo>     
+    </target>
+    
+    <target name="delete-test">
+        <fail message="you were supposed to hit 'y'" >
+            <condition>
+                <equals arg1="n" arg2="${oktodelete}" />
+            </condition>
+        </fail>
+        <delete dir="${basedir}/temp" />
+        <available file="${basedir}/temp/Zorg/apache/flex/ant/tags/Project.as" property="project.doesnt.exist.after.delete" value="didn't get deleted" />
+        <fail message="temp/Project.as was not deleted">
+            <condition>
+                <available file="${basedir}/temp/Zorg/apache/flex/ant/tags/Project.as" />
+            </condition>
+        </fail>
+        <echo>Project.as ${project.doesnt.exist.after.delete}. Should NOT say: didn't get deleted</echo>
+        <xmlproperty file="${basedir}/test_data.xml" collapseAttributes="true" />
+        <fail message="xmlproperty did not work set property">
+            <condition>
+                <not>
+                    <isset property="project.property.environment" />
+                </not>
+            </condition>
+        </fail>
+        <fail message="xmlproperty did not work set property value">
+            <condition>
+                <not>
+                    <equals arg1="${project.property.environment}" arg2="env" />
+                </not>
+            </condition>
+        </fail>
+        <fail message="xmlproperty did not work for text node">
+            <condition>
+                <not>
+                    <equals arg1="${project.target.echo}" arg2="FLEX_HOME" />
+                </not>
+            </condition>
+        </fail>
+	</target>
+	
+    <target name="true-false-test">
+        <fail message="istrue isn't true">
+            <condition>
+                <not>
+                    <and>
+                    	<istrue value="true" />
+                    	<istrue value="on" />
+                    	<istrue value="yes" />
+                    </and>
+                </not>
+            </condition>
+        </fail>
+        <fail message="istrue is false">
+            <condition>
+                <or>
+                	<istrue value="false" />
+                	<istrue value="off" />
+                	<istrue value="no" />
+                </or>
+            </condition>
+        </fail>
+        <fail message="isfalse isn't false">
+            <condition>
+            	<not>
+	            	<and>
+	                	<isfalse value="false" />
+	                	<isfalse value="off" />
+	                	<isfalse value="no" />
+	                </and>
+            	</not>
+            </condition>
+        </fail>
+        <fail message="isfalse is true">
+            <condition>
+            	<or>
+                   	<isfalse value="true" />
+                   	<isfalse value="on" />
+                   	<isfalse value="yes" />
+                </or>
+            </condition>
+        </fail>
+        <echo>All istrue / isfalse tests pass</echo>
+    </target>
+
+    <target name="macunzip" unless="isWindows">
+        <mkdir dir="${basedir}/temp/untar" />
+        <untar compression="gzip" src="${basedir}/temp/apache-rat-0.10-src.tar.gz" dest="${basedir}/temp/untar" />
+        <fail message="untar did not result in expected files">
+            <condition>
+                <not>
+                    <available file="${basedir}/temp/untar/apache-rat-0.10/pom.xml" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+    
+    <target name="confirm-delete" unless="exitwhendone">
+        <input message="Ok to delete temp directory?"
+            validargs="y,n"
+            addproperty="oktodelete" />
+    </target>
+    
+    <target name="build" depends="init,compile"
+        description="Compiles SWC"/>
+
+    <target name="init" depends="clean"
+        description="Creates the deploy folders and sets app extension"/>
+
+    <target name="clean" description="Cleans up old files.">
+        <delete dir="${basedir}/temp" failOnError="false" includeEmptyDirs="true" />
+    </target>
+
+    <target name="compile" 
+        description="Compiles the SWC.">
+    </target>
+	
+    <target name="freespace-test" description="Runs the free sapce test">
+        <ant dir="${basedir}" antfile="freespace.xml" />
+    </target>
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/test_data.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/test_data.xml b/flex-installer/ant_on_air/tests/test_data.xml
new file mode 100644
index 0000000..df07180
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/test_data.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="ant_on_air_data" default="build">
+
+    <!--load environment variables prefixed with env -->
+    <property environment="env"/>
+
+    <!--
+        Properties are immutable so value frozen first time property is set.
+        If FLEX_HOME is not set with -DFLEX_HOME=/path/to/flex/sdk on the ant command line
+        use the environment variable, if it exists. Else if windows, use FLEX_HOME_WIN
+        else use FLEX_HOME_MAC, which are both defined in build.properties.
+    -->
+    <condition property="FLEX_HOME" value="${env.FLEX_HOME}">
+        <isset property="env.FLEX_HOME" />
+    </condition>
+
+
+	<target name="test">
+		<echo>FLEX_HOME</echo>
+        <mkdir dir="${basedir}/temp" />
+	</target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/f954e6f6/flex-installer/ant_on_air/tests/testpropertiesfile.xml
----------------------------------------------------------------------
diff --git a/flex-installer/ant_on_air/tests/testpropertiesfile.xml b/flex-installer/ant_on_air/tests/testpropertiesfile.xml
new file mode 100644
index 0000000..016fe78
--- /dev/null
+++ b/flex-installer/ant_on_air/tests/testpropertiesfile.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<project name="ant_on_air_test" basedir="." default="test">
+
+    <!--location of property file -->
+    <property file="${basedir}/test.properties" description="Properties for Ant On AIR project" />
+
+	<target name="test" >
+        <echo>${test1}</echo>
+        <fail message="test1 was not 'basedir'">
+            <condition>
+                <not>
+                    <equals arg1="basedir" arg2="${test1}" />
+                </not>
+            </condition>
+        </fail>
+        <echo>${test2}</echo>
+        <fail message="test2 was not expanded">
+            <condition>
+                <not>
+                    <equals arg1="${basedir}" arg2="${test2}" />
+                </not>
+            </condition>
+        </fail>
+        <echo>${test3}</echo>
+        <fail message="test3 was expanded">
+            <condition>
+                <equals arg1="${basedir}" arg2="${test3}" />
+            </condition>
+        </fail>
+        <echo>${test4}</echo>
+        <fail message="test4 was expanded">
+            <condition>
+                <not>
+                    <equals arg1="Foo is $${basedir}" arg2="${test4}" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+</project>


Mime
View raw message