ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1375951 - in /ant/ivy/updatesite/trunk: build.properties build.xml
Date Wed, 22 Aug 2012 09:21:30 GMT
Author: hibou
Date: Wed Aug 22 09:21:30 2012
New Revision: 1375951

URL: http://svn.apache.org/viewvc?rev=1375951&view=rev
Log:
Make the build more resilient to incomplete download by checking the MD5

Modified:
    ant/ivy/updatesite/trunk/build.properties
    ant/ivy/updatesite/trunk/build.xml

Modified: ant/ivy/updatesite/trunk/build.properties
URL: http://svn.apache.org/viewvc/ant/ivy/updatesite/trunk/build.properties?rev=1375951&r1=1375950&r2=1375951&view=diff
==============================================================================
--- ant/ivy/updatesite/trunk/build.properties (original)
+++ ant/ivy/updatesite/trunk/build.properties Wed Aug 22 09:21:30 2012
@@ -23,9 +23,9 @@ eclipse.consoleLog=false
 
 # properties for jenkins build environment
 jenkins.baseUrl=http://builds.apache.org/
-jenkins.eclipse.name=eclipse-SDK-3.7.1-win32
-jenkins.eclipse.dropFile=R-3.7.1-201109091335/${jenkins.eclipse.name}.zip
-jenkins.eclipse.download.url=http://www.eclipse.org/downloads/download.php
-jenkins.eclipse.mirror.url=http://carroll.aset.psu.edu/pub/eclipse/eclipse/downloads/drops
-jenkins.eclipse.mirror.id=546
-jenkins.eclipse.url=${jenkins.eclipse.download.url}?file=/eclipse/downloads/drops/${jenkins.eclipse.dropFile}&url=${jenkins.eclipse.mirror.url}/${jenkins.eclipse.dropFile}&mirror_id=${jenkins.eclipse.mirror.id}
+jenkins.download.baseurl=http://www.eclipse.org/downloads/download.php
+jenkins.download.mirror.url=http://carroll.aset.psu.edu/pub/eclipse
+jenkins.download.mirror.id=546
+jenkins.download.sdk.name=eclipse-SDK-3.7.1-win32
+jenkins.download.sdk.dropdir=eclipse/downloads/drops/R-3.7.1-201109091335
+jenkins.download.sdk.md5=078df5550176e176abdbac1f444725fe

Modified: ant/ivy/updatesite/trunk/build.xml
URL: http://svn.apache.org/viewvc/ant/ivy/updatesite/trunk/build.xml?rev=1375951&r1=1375950&r2=1375951&view=diff
==============================================================================
--- ant/ivy/updatesite/trunk/build.xml (original)
+++ ant/ivy/updatesite/trunk/build.xml Wed Aug 22 09:21:30 2012
@@ -394,6 +394,32 @@ ${ASL2-header}
         ===================================================================================================================
   
       -->
 
+    <!-- wrapper of eclipse download urls which have a common pattern -->
+    <macrodef name="check-eclipse-download">
+        <attribute name="property" />
+        <attribute name="name" />
+        <attribute name="md5" />
+        <sequential>
+            <echo file="${basedir}/dependencies/@{name}.zip.md5" message="@{md5}" />
+            <condition property="@{property}">
+                <and>
+                    <available file="${basedir}/dependencies/@{name}.zip" />
+                    <checksum file="${basedir}/dependencies/@{name}.zip" algorithm="MD5"
/>
+                </and>
+            </condition>
+        </sequential>
+    </macrodef>
+    <macrodef name="eclipse-download">
+        <attribute name="name" />
+        <attribute name="dropdir" />
+        <sequential>
+            <mkdir dir="${basedir}/dependencies" />
+            <delete file="${basedir}/dependencies/@{name}.zip" failonerror="false" />
+            <get src="${jenkins.download.baseurl}?file=/@{dropdir}/@{name}.zip&amp;url=${jenkins.download.mirror.url}/@{dropdir}/@{name}.zip&amp;mirror_id=${jenkins.download.mirror.id}"
dest="${basedir}/dependencies/@{name}.zip" verbose="yes" />
+            <checksum file="${basedir}/dependencies/@{name}.zip" algorithm="MD5" />
+        </sequential>
+    </macrodef>
+
     <target name="jenkins-prepare" depends="jenkins-prepare-eclipse">
         <!-- we don't want to modify the checked in updatesite, so we will make it build
in another place -->
         <echo file="local.build.properties">
@@ -406,28 +432,27 @@ baseLocation=${basedir}/dependencies/${j
         <delete dir="${basedir}/build" />
     </target>
 
-    <target name="jenkins-prepare-eclipse" depends="jenkins-get-eclipse,jenkins-unzip-eclipse"
/>
+    <target name="jenkins-prepare-eclipse" depends="jenkins-get-sdk,jenkins-unzip-eclipse"
/>
 
-    <target name="jenkins-check-download-eclipse">
-        <condition property="jenkins.eclipse.downloaded">
-            <available file="${basedir}/dependencies/${jenkins.eclipse.name}.zip" />
-        </condition>
+    <target name="jenkins-check-download-sdk">
+        <check-eclipse-download name="${jenkins.download.sdk.name}" property="jenkins.sdk.downloaded"
md5="${jenkins.download.sdk.md5}" />
     </target>
 
-    <target name="jenkins-get-eclipse" depends="jenkins-check-download-eclipse" unless="jenkins.eclipse.downloaded">
-        <mkdir dir="${basedir}/dependencies" />
-        <get src="${jenkins.eclipse.url}" dest="${basedir}/dependencies/${jenkins.eclipse.name}.zip"
verbose="yes" />
+    <target name="jenkins-get-sdk" depends="jenkins-check-download-sdk" unless="jenkins.sdk.downloaded">
+        <eclipse-download name="${jenkins.download.sdk.name}" dropdir="${jenkins.download.sdk.dropdir}"
/>
     </target>
 
     <target name="jenkins-check-unzip-eclipse">
         <condition property="jenkins.eclipse.unzipped">
-            <available file="${basedir}/dependencies/${jenkins.eclipse.name}" />
+            <available file="${basedir}/dependencies/${jenkins.download.sdk.name}" />
         </condition>
     </target>
 
     <target name="jenkins-unzip-eclipse" depends="jenkins-check-unzip-eclipse" unless="jenkins.eclipse.unzipped">
-        <unzip src="${basedir}/dependencies/${jenkins.eclipse.name}.zip" dest="${basedir}/dependencies"
/>
-        <move file="${basedir}/dependencies/eclipse" tofile="${basedir}/dependencies/${jenkins.eclipse.name}"
/>
+        <delete dir="${basedir}/dependencies/eclipse" failonerror="false" />
+        <delete dir="${basedir}/dependencies/${jenkins.download.sdk.name}" failonerror="false"
/>
+        <unzip src="${basedir}/dependencies/${jenkins.download.sdk.name}.zip" dest="${basedir}/dependencies"
/>
+        <move file="${basedir}/dependencies/eclipse" tofile="${basedir}/dependencies/${jenkins.download.sdk.name}"
/>
     </target>
 
     <target name="jenkins-find-ivy-jar">



Mime
View raw message