ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [2/2] ant git commit: Add ability to send carbon copies to MailLogger. Submitted by Roman Savko PR: 57789
Date Sat, 18 Apr 2015 20:55:41 GMT
Add ability to send carbon copies to MailLogger.
Submitted by Roman Savko
PR: 57789


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/7bc97593
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/7bc97593
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/7bc97593

Branch: refs/heads/master
Commit: 7bc975931992d009a8203ae1d2655d6603d595d9
Parents: 1327e07
Author: Stefan Bodewig <stefan.bodewig@innoq.com>
Authored: Sat Apr 18 22:53:43 2015 +0200
Committer: Stefan Bodewig <stefan.bodewig@innoq.com>
Committed: Sat Apr 18 22:53:43 2015 +0200

----------------------------------------------------------------------
 CONTRIBUTORS                                    |  1 +
 WHATSNEW                                        |  3 ++
 contributors.xml                                |  4 +++
 manual/listeners.html                           | 20 ++++++++++++
 .../apache/tools/ant/listener/MailLogger.java   | 32 ++++++++++++++++++--
 5 files changed, 58 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/7bc97593/CONTRIBUTORS
----------------------------------------------------------------------
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index fffd4e4..564ce67 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -329,6 +329,7 @@ Rob van Oostrum
 Rodrigo Schmidt
 Roger Vaughn
 Roman Ivashin
+Roman Savko
 Ronen Mashal
 Russell Gold
 Ryan Bennitt

http://git-wip-us.apache.org/repos/asf/ant/blob/7bc97593/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index b3ffb29..939c5dc 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -104,6 +104,9 @@ Other changes:
  * performance improvements for <intersect>
    Bugzilla Report 57588
 
+ * MailLogger can now add CC and BCC addresses.
+   Bugzilla Report 57789.
+
 Changes from Ant 1.9.3 TO Ant 1.9.4
 ===================================
 

http://git-wip-us.apache.org/repos/asf/ant/blob/7bc97593/contributors.xml
----------------------------------------------------------------------
diff --git a/contributors.xml b/contributors.xml
index f7a638d..299cee8 100644
--- a/contributors.xml
+++ b/contributors.xml
@@ -1330,6 +1330,10 @@
     <last>Ivashin</last>
   </name>
   <name>
+    <first>Roman</first>
+    <last>Savko</last>
+  </name>
+  <name>
     <first>Ronen</first>
     <last>Mashal</last>
   </name>

http://git-wip-us.apache.org/repos/asf/ant/blob/7bc97593/manual/listeners.html
----------------------------------------------------------------------
diff --git a/manual/listeners.html b/manual/listeners.html
index 2a5cc73..2015cd5 100644
--- a/manual/listeners.html
+++ b/manual/listeners.html
@@ -218,6 +218,26 @@ control for turning off success or failure messages individually.</p>
     <td width="63%">Yes, if success mail is to be sent</td>
   </tr>
   <tr>
+    <td width="337">MailLogger.failure.cc </td>
+    <td width="63%">Address(es) to send failure messages to carbon copy (cc), comma-separated</td>
+    <td width="63%">No</td>
+  </tr>
+  <tr>
+    <td width="337">MailLogger.success.cc </td>
+    <td width="63%">Address(es) to send success messages to carbon copy (cc), comma-separated</td>
+    <td width="63%">No</td>
+  </tr>
+  <tr>
+    <td width="337">MailLogger.failure.bcc </td>
+    <td width="63%">Address(es) to send failure messages to blind carbon copy (bcc),
comma-separated</td>
+    <td width="63%">No</td>
+  </tr>
+  <tr>
+    <td width="337">MailLogger.success.bcc </td>
+    <td width="63%">Address(es) to send success messages to blind carbon copy (bcc),
comma-separated</td>
+    <td width="63%">No</td>
+  </tr>
+  <tr>
     <td width="337">MailLogger.failure.subject </td>
     <td width="63%">Subject of failed build</td>
     <td width="63%">No, default &quot;Build Failure&quot;</td>

http://git-wip-us.apache.org/repos/asf/ant/blob/7bc97593/src/main/org/apache/tools/ant/listener/MailLogger.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/listener/MailLogger.java b/src/main/org/apache/tools/ant/listener/MailLogger.java
index 8c0fff8..4b50547 100644
--- a/src/main/org/apache/tools/ant/listener/MailLogger.java
+++ b/src/main/org/apache/tools/ant/listener/MailLogger.java
@@ -65,6 +65,14 @@ import org.apache.tools.mail.MailMessage;
  *    to send failure messages to</li>
  *    <li> MailLogger.success.to [required if success mail to be sent] - Address
  *    to send success messages to</li>
+ *    <li> MailLogger.failure.cc [no default] - Address
+ *    to send failure messages to carbon copy (cc)</li>
+ *    <li> MailLogger.success.to [no default] - Address
+ *    to send success messages to carbon copy (cc)</li>
+ *    <li> MailLogger.failure.bcc [no default] - Address
+ *    to send failure messages to blind carbon copy (bcc)</li>
+ *    <li> MailLogger.success.bcc [no default] - Address
+ *    to send success messages to blind carbon copy (bcc)</li>
  *    <li> MailLogger.failure.subject [default: "Build Failure"] - Subject of
  *    failed build</li>
  *    <li> MailLogger.success.subject [default: "Build Success"] - Subject of
@@ -151,6 +159,8 @@ public class MailLogger extends DefaultLogger {
                 .from(getValue(properties, "from", null))
                 .replytoList(getValue(properties, "replyto", ""))
                 .toList(getValue(properties, prefix + ".to", null))
+                .toCcList(getValue(properties, prefix + ".cc", ""))
+                .toBccList(getValue(properties, prefix + ".bcc", ""))
                 .mimeType(getValue(properties, "mimeType", DEFAULT_MIME_TYPE))
                 .charset(getValue(properties, "charset", ""))
                 .body(getValue(properties, prefix + ".body", ""))
@@ -236,6 +246,22 @@ public class MailLogger extends DefaultLogger {
             this.toList = toList;
             return this;
         }
+        private String toCcList;
+        public String toCcList() {
+            return toCcList;
+        }
+        public Values toCcList(String toCcList) {
+            this.toCcList = toCcList;
+            return this;
+        }
+        private String toBccList;
+        public String toBccList() {
+            return toBccList;
+        }
+        public Values toBccList(String toBccList) {
+            this.toBccList = toBccList;
+            return this;
+        }
         private String subject;
         public String subject() {
             return subject;
@@ -392,8 +418,10 @@ public class MailLogger extends DefaultLogger {
         mailer.setReplyToList(replyToList);
         Vector<EmailAddress> toList = vectorizeEmailAddresses(values.toList());
         mailer.setToList(toList);
-        mailer.setCcList(new Vector<EmailAddress>());
-        mailer.setBccList(new Vector<EmailAddress>());
+        Vector<EmailAddress> toCcList = vectorizeEmailAddresses(values.toCcList());
+        mailer.setCcList(toCcList);
+        Vector<EmailAddress> toBccList = vectorizeEmailAddresses(values.toBccList());
+        mailer.setBccList(toBccList);
         mailer.setFiles(new Vector<File>());
         mailer.setSubject(values.subject());
         mailer.setHeaders(new Vector<Header>());


Mime
View raw message