bodewig     02/03/26 08:54:32

  Modified:    proposal/gump/project jakarta-ant.xml jakarta-tomcat.xml
                        jakarta-velocity.xml xml-axis.xml
               proposal/gump/java Project.java Workspace.java
  Log:
  Give workspace a chance to override nag/regexp/@to and the prefix in
  nag/regexp/@subject.
  
  In your workspace put
  
    <nag to="[EMAIL PROTECTED]" prefix="So what:" />
  
  default for to is whatever the descriptor specifies, default prefix is
  [GUMP].
  
  Revision  Changes    Path
  1.51      +2 -2      jakarta-alexandria/proposal/gump/project/jakarta-ant.xml
  
  Index: jakarta-ant.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/project/jakarta-ant.xml,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- jakarta-ant.xml   26 Mar 2002 13:48:31 -0000      1.50
  +++ jakarta-ant.xml   26 Mar 2002 16:54:31 -0000      1.51
  @@ -78,7 +78,7 @@
   
       <nag from="Diane Holt &lt;[EMAIL PROTECTED]&gt;"
            to="[EMAIL PROTECTED]"
  -         subject="[GUMP] Test Failure - Ant"/>
  +         subject="Test Failure - Ant"/>
     </project>
   
     <project name="bootstrap-ant">
  @@ -91,7 +91,7 @@
   
       <nag from="Diane Holt &lt;[EMAIL PROTECTED]&gt;"
            to="[EMAIL PROTECTED]"
  -         subject="[GUMP] Bootstrap Failure - Ant">
  +         subject="Bootstrap Failure - Ant">
         <regexp pattern="/error/"/>
         <regexp pattern="/Failed/"/>
         <regexp />      
  
  
  
  1.24      +1 -1      jakarta-alexandria/proposal/gump/project/jakarta-tomcat.xml
  
  Index: jakarta-tomcat.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/project/jakarta-tomcat.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- jakarta-tomcat.xml        26 Mar 2002 13:48:32 -0000      1.23
  +++ jakarta-tomcat.xml        26 Mar 2002 16:54:31 -0000      1.24
  @@ -36,7 +36,7 @@
   
       <nag to="[EMAIL PROTECTED]"
            from="Craig McClanahan &lt;[EMAIL PROTECTED]&gt;"
  -         subject="[GUMP] Build Failure - Tomcat 3.x"/>
  +         subject="Build Failure - Tomcat 3.x"/>
     </project>
   
   </module>
  
  
  
  1.43      +1 -1      jakarta-alexandria/proposal/gump/project/jakarta-velocity.xml
  
  Index: jakarta-velocity.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/project/jakarta-velocity.xml,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- jakarta-velocity.xml      26 Mar 2002 13:48:32 -0000      1.42
  +++ jakarta-velocity.xml      26 Mar 2002 16:54:31 -0000      1.43
  @@ -41,7 +41,7 @@
       <work nested="test/texen-classpath/test.jar"/>
       <nag to="[EMAIL PROTECTED]"
            from="Geir Magnusson Jr. &lt;[EMAIL PROTECTED]&gt;"
  -         subject="[GUMP] Test Failure - Velocity"/>
  +         subject="Test Failure - Velocity"/>
     </project>
   
     <project name="antlr.runtime">
  
  
  
  1.37      +2 -2      jakarta-alexandria/proposal/gump/project/xml-axis.xml
  
  Index: xml-axis.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/project/xml-axis.xml,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- xml-axis.xml      26 Mar 2002 13:48:32 -0000      1.36
  +++ xml-axis.xml      26 Mar 2002 16:54:31 -0000      1.37
  @@ -37,8 +37,8 @@
       <javadoc nested="java/build/javadocs"/>
       <nag from="Sam Ruby &lt;[EMAIL PROTECTED]&gt;"
            to="[EMAIL PROTECTED]">
  -      <regexp  subject="[GUMP] Build Failure - Axis"/>
  -      <regexp pattern="/timed out/" subject="[GUMP] Build timed out - Axis"/>
  +      <regexp  subject="Build Failure - Axis"/>
  +      <regexp pattern="/timed out/" subject="Build timed out - Axis"/>
       </nag>
     </project>
   
  
  
  
  1.40      +32 -4     jakarta-alexandria/proposal/gump/java/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/java/Project.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- Project.java      26 Mar 2002 13:48:34 -0000      1.39
  +++ Project.java      26 Mar 2002 16:54:32 -0000      1.40
  @@ -27,6 +27,9 @@
       private Element url;
       private Vector deliver = new Vector();
   
  +    private static String nagTo = null;
  +    private static String nagPrefix = null;
  +
       /**
        * Create a set of Project definitions based on XML nodes.
        * @param elements list of &lt;project&gt; elements
  @@ -708,12 +711,29 @@
        * Push attributes to nested regexp elements
        */
       private void expandNag(Element nag) {
  -        String subject = "[GUMP] Build Failure - "+name;
  -        String to = nag.getAttribute("to");
  +        if (nagPrefix == null) {
  +            Element workspaceNag = Workspace.getNag();
  +            if (workspaceNag == null) {
  +                nagPrefix = "[GUMP]";
  +            } else {
  +                if (!workspaceNag.getAttribute("prefix").equals("")) {
  +                    nagPrefix = workspaceNag.getAttribute("prefix");
  +                } else {
  +                    nagPrefix = "[GUMP]";
  +                }
  +                if (!workspaceNag.getAttribute("to").equals("")) {
  +                    nagTo = workspaceNag.getAttribute("to");
  +                }
  +            }
  +        }
  +        
  +
  +        String subject = nagPrefix + " Build Failure - "+name;
  +        String to = nagTo == null ? nag.getAttribute("to") : nagTo;
           String from = nag.getAttribute("from");
   
           if (!nag.getAttribute("subject").equals("")) {
  -            subject = nag.getAttribute("subject");
  +            subject = nagPrefix + " " + nag.getAttribute("subject");
           }
           
           if (!nag.hasChildNodes()) {
  @@ -733,12 +753,20 @@
                       if (regexp.getAttribute("pattern").equals("")) {
                           regexp.setAttribute("pattern", "/BUILD FAILED/");
                       }
  +
                       if (regexp.getAttribute("subject").equals("")) {
                           regexp.setAttribute("subject", subject);
  +                    } else {
  +                        String orig = regexp.getAttribute("subject");
  +                        regexp.setAttribute("subject", nagPrefix + " " + orig);
  +                        
                       }
  -                    if (regexp.getAttribute("to").equals("")) {
  +
  +                    if (nagTo != null 
  +                        || regexp.getAttribute("to").equals("")) {
                           regexp.setAttribute("to", to);
                       }
  +
                       if (regexp.getAttribute("from").equals("")) {
                           regexp.setAttribute("from", from);
                       }
  
  
  
  1.5       +11 -0     jakarta-alexandria/proposal/gump/java/Workspace.java
  
  Index: Workspace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/java/Workspace.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Workspace.java    20 Mar 2002 12:42:37 -0000      1.4
  +++ Workspace.java    26 Mar 2002 16:54:32 -0000      1.5
  @@ -11,6 +11,7 @@
       private static String basedir;
       private static Element javadoc;
       private static Element deliver;
  +    private static Element nag;
       private static HashMap servers = new HashMap();
       private static HashMap sites = new HashMap();
   
  @@ -47,6 +48,14 @@
       }
   
       /**
  +     * Static property accessor for nag element.
  +     * @return Javadoc element (if any) associated with this workspace
  +     */
  +    public static Element getNag() {
  +        return nag;
  +    }
  +
  +    /**
        * Static accessor - do we deliver to the given site?
        * @return true if a server of the given name is defined in the workspace.
        */
  @@ -118,6 +127,8 @@
           for (; child != null; child=child.getNextSibling()) {
               if (child.getNodeName().equals("javadoc")) {
                   javadoc = (Element) child;
  +            } else if (child.getNodeName().equals("nag")) {
  +                nag = (Element) child;
               } else if (child.getNodeName().equals("deliver")) {
                   handleDeliver((Element) child);
               }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to