harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r588491 - /harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml
Date Fri, 26 Oct 2007 03:16:14 GMT
Author: smishura
Date: Thu Oct 25 20:16:14 2007
New Revision: 588491

URL: http://svn.apache.org/viewvc?rev=588491&view=rev
Log:
More main publisher refactoring:
- move loading notification content to separate targets
- load only if required file exists
  this should eliminate from the notification messages like:
  "Unable to load file: java.io.FileNotFoundException"

Modified:
    harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml

Modified: harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml?rev=588491&r1=588490&r2=588491&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/publisher.xml Thu Oct 25 20:16:14 2007
@@ -45,10 +45,33 @@
                 <isfalse value="${thisbuildsuccessful}" />
             </and>
         </condition>
+
+        <condition property="if.mail.summary">
+            <and>
+                <isset property="to" />
+                <available file="${mail.summary}" />
+            </and>
+        </condition>
+        <condition property="if.mail.message">
+            <and>
+                <isset property="to" />
+                <available file="${mail.message}" />
+            </and>
+        </condition>
+    </target>
+
+    <target name="-load.mail.summary" if="if.mail.summary" depends="-configure">
+        <loadfile property="mail.summary.content" srcFile="${mail.summary}" />
     </target>
-    
+
+    <target name="-load.mail.message" if="if.mail.message" depends="-configure">
+        <loadfile property="mail.message.content" srcFile="${mail.message}" />
+    </target>
+
     <!-- implement publisher interface -->
-    <target name="publish" if="to" depends="-configure">
+    <target name="publish"
+            if="to"
+            depends="-configure,-load.mail.summary,-load.mail.message">
 
         <condition property="mail.execution.status"
                    value="PASSED"
@@ -61,6 +84,15 @@
         <property name="mail.subject.line"
                   value="${mail.subject.prefix} ${mail.execution.status} ${os.name} ${hy.arch}:
${suite.name} ${mail.subject.suffix}" />
 
+        <!-- empty message by default -->
+        <property name="mail.summary.content" value="" />
+        <property name="mail.message.content" value="" />
+
+        <!-- no execution logs to send by default -->
+        <property name="mail.execution.log" value="" />
+        <!-- no attachments by default -->
+        <property name="mail.attachs" value="" />
+
         <log message=""/>
         <log message="    Sending mail notification:"/>
         <log message="        smtp: '${mail}'"/>
@@ -73,25 +105,6 @@
 
         <trycatch property="mail.sending.exception">
         <try>
-            <if>
-                <available file="${mail.summary}"/>
-            <then>
-                <!-- 'if' suppresses 'nonexistence' warning -->
-                <loadfile property="mail.summary.content"
-                          srcFile="${mail.summary}"
-                          failonerror="false"/>
-            </then>
-            </if>
-            <property name="mail.summary.content" value=""/>
-            <loadfile property="mail.message.content"
-                      srcFile="${mail.message}"
-                      failonerror="false"/>
-            <!-- empty message by default -->
-            <property name="mail.message.content" value=""/>
-            <!-- no execution logs to send by default -->
-            <property name="mail.execution.log" value=""/> 
-            <!-- no attachments by default -->
-            <property name="mail.attachs" value=""/>
             <mail mailhost="${mail}"
                   tolist="${to}"
                   from="${mail.from}"



Mime
View raw message