royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-asjs] branch develop updated: fix cache handling for mirror downloads
Date Fri, 16 Mar 2018 17:33:31 GMT
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 16b30ec  fix cache handling for mirror downloads
16b30ec is described below

commit 16b30ec7e9eb4ffbf7da41b4248b5bea4ac8bddc
Author: Alex Harui <aharui@apache.org>
AuthorDate: Fri Mar 16 10:33:17 2018 -0700

    fix cache handling for mirror downloads
---
 frameworks/downloads.xml | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/frameworks/downloads.xml b/frameworks/downloads.xml
index ac69d5c..afbd33b 100644
--- a/frameworks/downloads.xml
+++ b/frameworks/downloads.xml
@@ -66,6 +66,9 @@
             <param name="file" value="${pixelbender.bin.zip}" />
             <param name="dest" value="${download.dir}/${pixelbender.bin.zip}" />
         </antcall>
+        <antcall target="get-from-cache-if-needed" >
+            <param name="filename" value="${pixelbender.bin.zip}" />
+        </antcall>
         
         <unzip src="${download.dir}/${pixelbender.bin.zip}" dest="${ROYALE_HOME}/frameworks/projects/Graphics/src/main/royale/org/apache/royale/graphics/utils/shaderClasses/">
             <patternset>
@@ -100,6 +103,9 @@
             <param name="file" value="${flexunit.bin.zip}" />
             <param name="dest" value="${download.dir}/${flexunit.bin.zip}" />
         </antcall>
+        <antcall target="get-from-cache-if-needed" >
+            <param name="filename" value="${flexunit.bin.zip}" />
+        </antcall>
         
         <unzip src="${download.dir}/${flexunit.bin.zip}" dest="${ROYALE_HOME}/in/flexunit"
/>
     </target>
@@ -377,20 +383,28 @@
         </antcall>
     </target>
     <target name="download_using_mirror" if="usingmirror">
-        <get src="${server}/${folder}/${file}?asjson=true" verbose="true" dest="${basedir}/mirror.json"
/>
+        <get src="${server}/${folder}/${file}?asjson=true" verbose="true" dest="${basedir}/mirror.json"
ignoreerrors="true" />
+        <antcall target="use_mirror" />
+    </target>
+    <target name="download_using_get" unless="usingmirror">
+        <get src="${server}/${folder}/${file}" dest="${dest}" ignoreerrors="true" />
+    </target>
+    <target name="check_mirror_json">
+        <condition property="mirror.json.exists" value="true">
+            <available file="${basedir}/mirror.json" />
+        </condition>
+    </target>
+    <target name="use_mirror" depends="check_mirror_json" if="mirror.json.exists">
         <replace file="${basedir}/mirror.json">
             <replacefilter token="&quot;"
             value="" />
             <replacefilter token=": "
             value="=" />
         </replace>
-        <property file="${basedir}/mirror.json" />
-        <delete file="${basedir}/mirror.json" />
+	<property file="${basedir}/mirror.json" />
+        <delete file="${basedir}/mirror.json" failonerror="false"/>
         <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}" />
+        <get src="${preferred}${folder}/${file}" dest="${dest}" ignoreerrors="true" />
     </target>
 
 </project>

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.

Mime
View raw message