Repository: flex-asjs
Updated Branches:
  refs/heads/release0.8.0 012a5bf0d -> f5345d38d


got installer to work with both AIR 23 and AIR 25


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f5345d38
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f5345d38
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f5345d38

Branch: refs/heads/release0.8.0
Commit: f5345d38d4f6f8b9ba825101c0c80d81cf9b55de
Parents: 012a5bf
Author: Alex Harui <[email protected]>
Authored: Fri May 12 00:00:29 2017 -0700
Committer: Alex Harui <[email protected]>
Committed: Fri May 12 00:00:29 2017 -0700

----------------------------------------------------------------------
 installer.xml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 48 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f5345d38/installer.xml
----------------------------------------------------------------------
diff --git a/installer.xml b/installer.xml
index 47fd118..ffe5f49 100644
--- a/installer.xml
+++ b/installer.xml
@@ -513,23 +513,66 @@
         </copy>
     </target>
     
-    <target name="air-setup-mac" unless="isWindows">
-        <!--The tbz2 contains symlinks which Ant does not preserve
-        <untar compression="bzip2" src="${download.dir}/${air.sdk.url.file}" 
dest="${download.dir}/airsdk" />-->
+    <target name="unzipOrMountDMG" description="Check for file extension and 
decide if we should unzip or mount">
+        
         <mkdir dir="${download.dir}/airsdk" />
         <move file="${download.dir}/${air.sdk.url.file}" 
todir="${download.dir}/airsdk" />
-        <exec executable="bunzip2" dir="${download.dir}/airsdk" >
+        
+        <condition property="shouldUnzip" value="true">
+            <matches pattern="tbz2" string="${air.sdk.url.file}"/>
+        </condition>
+        <echo message="Should unzip: ${shouldUnzip}"/>
+    </target>
+    
+    <target name="unzipAIRSDK" if="shouldUnzip">
+        <echo message="Unzipping"/>
+        
+        <!--The tbz2 contains symlinks which Ant does not preserve
+         <untar compression="bzip2" src="${download.dir}/${air.sdk.url.file}" 
dest="${download.dir}/airsdk" />-->
+        
+        <exec executable="bunzip2" dir="${download.dir}/airsdk">
             <arg value="${air.sdk.url.file}" />
         </exec>
         <echo 
file="${basedir}/airtar.properties">air.tar.name=${air.sdk.url.file}</echo>
         <replace file="${basedir}/airtar.properties" token="tbz2" value="tar" 
/>
         <property file="${basedir}/airtar.properties" />
-        <exec executable="tar" dir="${download.dir}/airsdk" >
+        <exec executable="tar" dir="${download.dir}/airsdk">
             <arg value="-xvf" />
             <arg value="${air.tar.name}" />
         </exec>
         <echo>${INFO_FINISHED_UNTARING} 
${download.dir}/airsdk/${air.tar.name}</echo>
         <delete file="${basedir}/airtar.properties" />
+    </target>
+    
+    <target name="mountAIRSDK" unless="shouldUnzip">
+        <echo message="Mounting dmg"/>
+        <exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
+            <arg value="attach"/>
+            <arg value="-nobrowse"/>
+            <arg value="${download.dir}/airsdk/${air.sdk.url.file}"/>
+        </exec>
+    </target>
+    
+    <target name="copyFromMount" unless="shouldUnzip">
+        <echo message="Copying AIR SDK from mounted volume"/>
+        <exec executable="rsync" dir="${FLEXJS_HOME}">
+            <arg value="--archive" />
+            <arg value="--ignore-existing" />
+            <arg value="--force" />
+            <arg value="/Volumes/AIR SDK/"/>
+            <arg value="${download.dir}/airsdk" />
+        </exec>
+    </target>
+    
+    <target name="unmountAIRSDK" unless="shouldUnzip">
+        <echo message="Unmounting AIR SDK"/>
+        <exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="false">
+            <arg value="unmount"/>
+            <arg value="/Volumes/AIR SDK"/>
+        </exec>
+    </target>
+    
+    <target name="air-setup-mac" 
depends="unzipOrMountDMG,unzipAIRSDK,mountAIRSDK,copyFromMount,unmountAIRSDK" 
unless="isWindows">
         <antcall target="mac-copy-file">
             <param name="srcdir" value="." />
             <param name="filename" value="AIR SDK license.pdf"/>

Reply via email to