flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/2] flex-typedefs git commit: allow typedefs to get their downloads from the cache in case the true source is unavailable
Date Tue, 25 Oct 2016 19:55:38 GMT
Repository: flex-typedefs
Updated Branches:
  refs/heads/develop 08f98e831 -> e0f9b7a13


allow typedefs to get their downloads from the cache in case the true source is unavailable


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

Branch: refs/heads/develop
Commit: e0f9b7a1354a97b87e17d7a61291556678f54cdf
Parents: 4f6ee20
Author: Alex Harui <aharui@apache.org>
Authored: Tue Oct 25 12:55:30 2016 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Oct 25 12:55:36 2016 -0700

----------------------------------------------------------------------
 createjs/build.xml    |  47 +++++++++++-
 google_maps/build.xml |  36 ++++++++-
 jasmine/build.xml     |  38 +++++++++-
 jquery/build.xml      |  38 +++++++++-
 js/build.xml          |  37 ++++++++-
 node/build.xml        | 183 ++++++++++++++++++++++++++++++++++++++-------
 6 files changed, 345 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-typedefs/blob/e0f9b7a1/createjs/build.xml
----------------------------------------------------------------------
diff --git a/createjs/build.xml b/createjs/build.xml
index 2317049..86b9e41 100644
--- a/createjs/build.xml
+++ b/createjs/build.xml
@@ -85,13 +85,31 @@
     <target name="download" >
         <mkdir dir="${basedir}/target/downloads" />
         <get src="https://github.com/CreateJS/EaselJS/archive/${createjs.version}.zip"
-            dest="${basedir}/target/downloads/easel-${createjs.version}.zip" skipexisting="true"/>
+            dest="${basedir}/target/downloads/easel-${createjs.version}.zip" skipexisting="true"
ignoreerrors="true"/>
+        <antcall target="get-from-cache-if-needed" >
+            <param name="srcFile" value="easel-${createjs.version}.zip" />
+            <param name="destFile" value="easel-${createjs.version}.zip" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
+        <antcall target="fail-if-not-found" >
+            <param name="destFile" value="easel-${createjs.version}.zip" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
     </target>
     
     <target name="download_tween" >
         <mkdir dir="${basedir}/target/downloads" />
         <get src="https://github.com/CreateJS/TweenJS/archive/${tweenjs.version}.zip"
-            dest="${basedir}/target/downloads/tween-${tweenjs.version}.zip" skipexisting="true"/>
+            dest="${basedir}/target/downloads/tween-${tweenjs.version}.zip" skipexisting="true"
ignoreerrors="true"/>
+        <antcall target="get-from-cache-if-needed" >
+            <param name="srcFile" value="tween-${tweenjs.version}.zip" />
+            <param name="destFile" value="tween-${tweenjs.version}.zip" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
+        <antcall target="fail-if-not-found" >
+            <param name="destFile" value="tween-${tweenjs.version}.zip" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
     </target>
 
     <!-- createjs files have certain patterns that fool our compilers.
@@ -577,4 +595,29 @@
         <delete dir="${basedir}/target" />
     </target>
 
+    <target name="fail-if-not-found">
+        <fail message="${destDir}/${destFile} could not be downloaded or found in cache">
+            <condition>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+
+    <target name="double-check-file" >
+        <echo>${env.FLEX_DOWNLOAD_CACHE}</echo>
+        <condition property="still-no-file" value="true">
+            <and>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+                <isset property="env.FLEX_DOWNLOAD_CACHE" />
+            </and>
+        </condition>
+        <echo>Need file: ${still_no_file}</echo>
+    </target>
+    <target name="get-from-cache-if-needed" depends="double-check-file" if="still-no-file">
+        <copy file="${env.FLEX_DOWNLOAD_CACHE}/${srcFile}" tofile="${destDir}/${destFile}"
/>
+    </target>
 </project>

http://git-wip-us.apache.org/repos/asf/flex-typedefs/blob/e0f9b7a1/google_maps/build.xml
----------------------------------------------------------------------
diff --git a/google_maps/build.xml b/google_maps/build.xml
index 17d99b3..ea28b97 100644
--- a/google_maps/build.xml
+++ b/google_maps/build.xml
@@ -103,7 +103,16 @@
 
     <target name="download" >
         <mkdir dir="${basedir}/target/downloads" />
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/maps/google_maps_api_v3_11.js"
dest="${basedir}/target/downloads/google_maps_api_v3_11.js" />
+        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/maps/google_maps_api_v3_11.js"
dest="${basedir}/target/downloads/google_maps_api_v3_11.js" ignoreerrors="true"/>
+        <antcall target="get-from-cache-if-needed" >
+            <param name="srcFile" value="google_maps_api_v3_11.js" />
+            <param name="destFile" value="google_maps_api_v3_11.js" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
+        <antcall target="fail-if-not-found" >
+            <param name="destFile" value="google_maps_api_v3_11.js" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
     </target>
     
     <target name="preprocessfile" >
@@ -184,4 +193,29 @@ google.maps = {};]]></replacevalue>
         </delete>
     </target>
 
+    <target name="fail-if-not-found">
+        <fail message="${destDir}/${destFile} could not be downloaded or found in cache">
+            <condition>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+
+    <target name="double-check-file" >
+        <echo>${env.FLEX_DOWNLOAD_CACHE}</echo>
+        <condition property="still-no-file" value="true">
+            <and>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+                <isset property="env.FLEX_DOWNLOAD_CACHE" />
+            </and>
+        </condition>
+        <echo>Need file: ${still_no_file}</echo>
+    </target>
+    <target name="get-from-cache-if-needed" depends="double-check-file" if="still-no-file">
+        <copy file="${env.FLEX_DOWNLOAD_CACHE}/${srcFile}" tofile="${destDir}/${destFile}"
/>
+    </target>
 </project>

http://git-wip-us.apache.org/repos/asf/flex-typedefs/blob/e0f9b7a1/jasmine/build.xml
----------------------------------------------------------------------
diff --git a/jasmine/build.xml b/jasmine/build.xml
index 927b21d..5efe733 100644
--- a/jasmine/build.xml
+++ b/jasmine/build.xml
@@ -81,7 +81,16 @@
 
     <target name="preprocess">
         <mkdir dir="${basedir}/target/downloads" />
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jasmine-2.0.js"
dest="${basedir}/target/downloads/jasmine-2.0.js" skipexisting="true"/>
+        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jasmine-2.0.js"
dest="${basedir}/target/downloads/jasmine-2.0.js" skipexisting="true" ignoreerrors="true"/>
+        <antcall target="get-from-cache-if-needed" >
+            <param name="srcFile" value="jasmine-2.0.js" />
+            <param name="destFile" value="jasmine-2.0.js" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
+        <antcall target="fail-if-not-found" >
+            <param name="destFile" value="jasmine-2.0.js" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
     </target>
     
     <target name="externc" >
@@ -125,4 +134,31 @@
             </fileset>
         </delete>
     </target>
+
+    <target name="fail-if-not-found">
+        <fail message="${destDir}/${destFile} could not be downloaded or found in cache">
+            <condition>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+
+    <target name="double-check-file" >
+        <echo>${env.FLEX_DOWNLOAD_CACHE}</echo>
+        <condition property="still-no-file" value="true">
+            <and>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+                <isset property="env.FLEX_DOWNLOAD_CACHE" />
+            </and>
+        </condition>
+        <echo>Need file: ${still_no_file}</echo>
+    </target>
+    <target name="get-from-cache-if-needed" depends="double-check-file" if="still-no-file">
+        <copy file="${env.FLEX_DOWNLOAD_CACHE}/${srcFile}" tofile="${destDir}/${destFile}"
/>
+    </target>
+
 </project>

http://git-wip-us.apache.org/repos/asf/flex-typedefs/blob/e0f9b7a1/jquery/build.xml
----------------------------------------------------------------------
diff --git a/jquery/build.xml b/jquery/build.xml
index 9fa1040..6a0887f 100644
--- a/jquery/build.xml
+++ b/jquery/build.xml
@@ -118,7 +118,16 @@
 
     <target name="download" >
         <mkdir dir="${basedir}/target/downloads" />
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jquery-1.9.js"
dest="${basedir}/target/downloads/jquery-1.9.js"/>
+        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/jquery-1.9.js"
dest="${basedir}/target/downloads/jquery-1.9.js" ignoreerrors="true"/>
+        <antcall target="get-from-cache-if-needed" >
+            <param name="srcFile" value="jquery-1.9.js" />
+            <param name="destFile" value="jquery-1.9.js" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
+        <antcall target="fail-if-not-found" >
+            <param name="destFile" value="jquery-1.9.js" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
     </target>
     
     <target name="externc" >
@@ -162,4 +171,31 @@
             </fileset>
         </delete>
     </target>
+    
+    <target name="fail-if-not-found">
+        <fail message="${destDir}/${destFile} could not be downloaded or found in cache">
+            <condition>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+    
+    <target name="double-check-file" >
+        <echo>${env.FLEX_DOWNLOAD_CACHE}</echo>
+        <condition property="still-no-file" value="true">
+            <and>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+                <isset property="env.FLEX_DOWNLOAD_CACHE" />
+            </and>
+        </condition>
+        <echo>Need file: ${still_no_file}</echo>
+    </target>
+    <target name="get-from-cache-if-needed" depends="double-check-file" if="still-no-file">
+        <copy file="${env.FLEX_DOWNLOAD_CACHE}/${srcFile}" tofile="${destDir}/${destFile}"
/>
+    </target>
+
 </project>

http://git-wip-us.apache.org/repos/asf/flex-typedefs/blob/e0f9b7a1/js/build.xml
----------------------------------------------------------------------
diff --git a/js/build.xml b/js/build.xml
index 528b048..eb1ba0e 100644
--- a/js/build.xml
+++ b/js/build.xml
@@ -90,7 +90,16 @@
         </unjar>
         <mkdir dir="${basedir}/target/downloads" />
         <unzip src="${basedir}/target/temp/externs/externs.zip" dest="${basedir}/target/downloads"
/>
-        <get src="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/closureidl/svg.js"
dest="${basedir}/target/downloads/svg.js"/>
+        <get src="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/closureidl/svg.js"
dest="${basedir}/target/downloads/svg.js" ignoreerrors="true"/>
+        <antcall target="get-from-cache-if-needed" >
+            <param name="srcFile" value="svg.js" />
+            <param name="destFile" value="svg.js" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
+        <antcall target="fail-if-not-found" >
+            <param name="destFile" value="svg.js" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
     </target>
     
     <target name="make_patch" depends="download">
@@ -182,4 +191,30 @@
         </delete>
     </target>
 
+    <target name="fail-if-not-found">
+        <fail message="${destDir}/${destFile} could not be downloaded or found in cache">
+            <condition>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+
+    <target name="double-check-file" >
+        <echo>${env.FLEX_DOWNLOAD_CACHE}</echo>
+        <condition property="still-no-file" value="true">
+            <and>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+                <isset property="env.FLEX_DOWNLOAD_CACHE" />
+            </and>
+        </condition>
+        <echo>Need file: ${still_no_file}</echo>
+    </target>
+    <target name="get-from-cache-if-needed" depends="double-check-file" if="still-no-file">
+        <copy file="${env.FLEX_DOWNLOAD_CACHE}/${srcFile}" tofile="${destDir}/${destFile}"
/>
+    </target>
+
 </project>

http://git-wip-us.apache.org/repos/asf/flex-typedefs/blob/e0f9b7a1/node/build.xml
----------------------------------------------------------------------
diff --git a/node/build.xml b/node/build.xml
index 578047c..e7474b4 100644
--- a/node/build.xml
+++ b/node/build.xml
@@ -79,36 +79,136 @@
         
     <target name="main" depends="preprocess, externc, postprocess, compc" />
 
+    <property name="srcServer" value="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs"
/>
+    <property name="destDir" value="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs"
/>
+    
+    <target name="getfile" >
+        <get src="${srcServer}/${srcFile}" dest="${destDir}/${destFile}" skipexisting="true"
ignoreerrors="true"/>
+        <antcall target="get-from-cache-if-needed" >
+            <param name="srcFile" value="${srcFile}" />
+            <param name="destFile" value="${srcFile}" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
+        <antcall target="fail-if-not-found" >
+            <param name="destFile" value="${srcFile}" />
+            <param name="destDir" value="${basedir}/target/downloads" />
+        </antcall>
+    </target>
+    
     <target name="preprocess">
         <mkdir dir="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs"
/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/assert.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/assert.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/buffer.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/buffer.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/child_process.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/child_process.js"
skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/cluster.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/cluster.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/crypto.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/crypto.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/dgram.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/dgram.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/dns.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/dns.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/domain.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/domain.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/events.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/events.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/fs.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/fs.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/globals.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/globals.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/http.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/http.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/https.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/https.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/net.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/net.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/os.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/os.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/path.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/path.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/punycode.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/punycode.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/querystring.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/querystring.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/readline.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/readline.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/repl.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/repl.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/stream.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/stream.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/string_decoder.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/string_decoder.js"
skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/tls.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/tls.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/tty.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/tty.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/url.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/url.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/util.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/util.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/vm.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/vm.js" skipexisting="true"/>
-        <get src="https://raw.githubusercontent.com/google/closure-compiler/master/contrib/nodejs/zlib.js"
dest="${basedir}/target/downloads/closure-compiler-master/contrib/nodejs/zlib.js" skipexisting="true"/>
+        <antcall target="getfile">
+            <param name="srcFile" value="assert.js" />
+            <param name="destFile" value="assert.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="buffer.js" />
+            <param name="destFile" value="buffer.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="child_process.js" />
+            <param name="destFile" value="child_process.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="cluster.js" />
+            <param name="destFile" value="cluster.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="crypto.js" />
+            <param name="destFile" value="crypto.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="dgram.js" />
+            <param name="destFile" value="dgram.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="dns.js" />
+            <param name="destFile" value="dns.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="domain.js" />
+            <param name="destFile" value="domain.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="events.js" />
+            <param name="destFile" value="events.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="fs.js" />
+            <param name="destFile" value="fs.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="globals.js" />
+            <param name="destFile" value="globals.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="http.js" />
+            <param name="destFile" value="http.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="https.js" />
+            <param name="destFile" value="https.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="net.js" />
+            <param name="destFile" value="net.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="os.js" />
+            <param name="destFile" value="os.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="path.js" />
+            <param name="destFile" value="path.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="punycode.js" />
+            <param name="destFile" value="punycode.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="querystring.js" />
+            <param name="destFile" value="querystring.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="readline.js" />
+            <param name="destFile" value="readline.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="repl.js" />
+            <param name="destFile" value="repl.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="stream.js" />
+            <param name="destFile" value="stream.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="string_decoder.js" />
+            <param name="destFile" value="string_decoder.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="tls.js" />
+            <param name="destFile" value="tls.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="tty.js" />
+            <param name="destFile" value="tty.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="url.js" />
+            <param name="destFile" value="url.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="util.js" />
+            <param name="destFile" value="util.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="vm.js" />
+            <param name="destFile" value="vm.js"/>
+        </antcall>
+        <antcall target="getfile">
+            <param name="srcFile" value="zlib.js" />
+            <param name="destFile" value="zlib.js"/>
+        </antcall>
     </target>
     
     <target name="externc" >
@@ -152,4 +252,31 @@
             </fileset>
         </delete>
     </target>
+
+    <target name="fail-if-not-found">
+        <fail message="${destDir}/${destFile} could not be downloaded or found in cache">
+            <condition>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+            </condition>
+        </fail>
+    </target>
+
+    <target name="double-check-file" >
+        <echo>${env.FLEX_DOWNLOAD_CACHE}</echo>
+        <condition property="still-no-file" value="true">
+            <and>
+                <not>
+                    <available file="${destDir}/${destFile}" />
+                </not>
+                <isset property="env.FLEX_DOWNLOAD_CACHE" />
+            </and>
+        </condition>
+        <echo>Need file: ${still_no_file}</echo>
+    </target>
+    <target name="get-from-cache-if-needed" depends="double-check-file" if="still-no-file">
+        <copy file="${env.FLEX_DOWNLOAD_CACHE}/${srcFile}" tofile="${destDir}/${destFile}"
/>
+    </target>
+
 </project>


Mime
View raw message