add sdk so font swf gets built

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

Branch: refs/heads/master
Commit: 4fbf2ee452b4ce1cc4851fba140d370117b6ba2f
Parents: 8dc9a6a
Author: Alex Harui <[email protected]>
Authored: Sun Nov 1 22:59:26 2015 -0800
Committer: Alex Harui <[email protected]>
Committed: Sun Nov 1 22:59:26 2015 -0800

----------------------------------------------------------------------
 ApproveFlexJS.xml | 52 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 49 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4fbf2ee4/ApproveFlexJS.xml
----------------------------------------------------------------------
diff --git a/ApproveFlexJS.xml b/ApproveFlexJS.xml
index 255bc34..e9044df 100644
--- a/ApproveFlexJS.xml
+++ b/ApproveFlexJS.xml
@@ -118,6 +118,10 @@
         type="dir"
         property="FLEXUNIT_HOME" value="${env.FLEXUNIT_HOME}" />
     
+    <available file="${env.FLEX_HOME}"
+        type="dir"
+        property="FLEX_SDK_HOME" value="${env.FLEX_HOME}" />
+    
     <available file="${env.ANT_HOME}/lib/${apache.rat.jar}"
         type="file"
         property="apache.rat.found"/>
@@ -368,12 +372,12 @@
 
     <target name="ask.build">
         <input
-        message="The final step is to run the build and any tests the build 
script runs.  This can take several minutes.  Press y to start the build."
+        message="The final step is to run the build and any tests the build 
script runs.  This can take several minutes.  You will be asked to accept the 
Adobe license for the font jars.  Press y to start the build."
         validargs="y"
         defaultvalue="y" />
     </target>
 
-    <target name="build" depends="ask.build,get.dependencies,copy.downloads">
+    <target name="build" 
depends="ask.build,ask-font,get.dependencies,copy.downloads">
         <ant dir="${basedir}/${package.url.name}" target="main" />
         <ant dir="${basedir}/${package.url.name}" target="examples" />
     </target>
@@ -385,7 +389,30 @@
                </copy>
     </target>
     
-    <target name="get.dependencies" 
depends="set.falcon.flags,get.falcon.if.needed,get.flexunit.if.needed" />
+    <!-- Prompt before downloading.  -->
+    <target name="ask-font" unless="font.donot.ask"
+        description="Prompt the user before downloading BlaseDS">
+        
+        <property name="font.prompt.text"
+        value="Apache Flex can optionally integrate with Adobe's embedded font 
support.
+        ${line.separator}This feature requires a few font jars from the Adobe 
Flex SDK.
+        ${line.separator}The Adobe SDK license agreement for Adobe Flex 4.6 
applies to these jars.
+        ${line.separator}This license is not compatible with the Apache v2 
license.
+        ${adobe.flex.license}
+        ${line.separator}Do you want to install these jars from the Adobe Flex 
SDK?"/>
+        <input
+        message="${font.prompt.text}"
+        validargs="y,n"
+        defaultvalue="n"
+        addproperty="input.font.download"/>
+        <condition property="do.font.install">
+            <equals arg1="y" arg2="${input.font.download}"/>
+        </condition>
+        <!-- Only ask once per ant run.  -->
+        <property name="font.donot.ask" value="set"/>
+    </target>
+    
+    <target name="get.dependencies" 
depends="set.falcon.flags,get.falcon.if.needed,get.sdk.if.needed,get.flexunit.if.needed"
 />
     <target name="set.falcon.flags" >
         <condition property="falcon.nightly">
             <and>
@@ -487,6 +514,25 @@
         <unzip src="${basedir}/${binary.flexunit.kit}.zip" 
dest="${basedir}/flexunit" />
         <property name="FLEXUNIT_HOME" value="${basedir}/flexunit" />
     </target>
+    <target name="get.sdk.if.needed" depends="get.sdk" unless="FLEX_SDK_HOME" 
/>
+    <target name="get.sdk">
+        <property name="kit.sdk.prefix" value="apache-flex-sdk-4.14.1"/>
+        <property name="binary.sdk.kit" value="${kit.sdk.prefix}-bin"/>
+        <get 
src="https://archive.apache.org/dist/flex/4.14.1/binaries/${binary.sdk.kit}.zip";
+        dest="${basedir}/${binary.sdk.kit}.zip" verbose="true" 
skipexisting="true"/>
+        <get 
src="https://archive.apache.org/dist/flex/4.14.1/binaries/${binary.sdk.kit}.zip.md5";
+        dest="${basedir}/${binary.sdk.kit}.zip.md5" verbose="true" 
skipexisting="true"/>
+        <checksum file="${basedir}/${binary.sdk.kit}.zip" algorithm="md5" 
verifyproperty="sdk.md5.ok" />
+        <condition property="SDKMD5Invalid">
+            <not>
+                <equals arg1="${sdk.md5.ok}" arg2="true" />
+            </not>
+        </condition>
+        <fail message="MD5 checksum did not match" if="SDKMD5Invalid" />
+        <unzip src="${basedir}/${binary.sdk.kit}.zip" dest="${basedir}/sdk" />
+        <ant dir="${basedir}/sdk/frameworks" antfile="downloads.xml" />
+        <property name="FLEX_SDK_HOME" value="${basedir}/sdk" />
+    </target>
     
        <target name="approve" >
                <condition property="vote" value="+1">

Reply via email to