bodewig     02/03/04 00:08:18

  Modified:    proposal/gump build.xml
               proposal/gump/java Jenny.java Project.java
               proposal/gump/profile gump.xml
  Log:
  Make descriptor parsing more robust:
  
  (1) If a module definition cannot be loaded, drop the module
      (beepcore.xml right now)
  
  (2) If a project descriptor is invalid, drop the project.
  
  (3) If a project states a dependency that cannot be resolved, drop the
      project.
      (jakarta-turbine-maven right now).
  
  As a side effect, uncomment jakarta-turbine-maven as it doesn't cause
  any harm any longer.
  
  Snipped output of gen.sh on my box now:
  
  Error parsing file project/beepcore.xml line 0:
  Failed to expand module with href project/beepcore.xml because of exception 
org.xml.sax.SAXParseException: File "file:///.../gump/project/beepcore.xml" not found.
  Error parsing file project/beepcore.xml line 0:
  Failed to expand module with href project/beepcore.xml because of exception 
org.xml.sax.SAXParseException: File "file:///.../gump/project/beepcore.xml" not found.
  Dropping commons-altrmi because of Exception java.lang.Exception: project "beepcore" 
not found processing project commons-altrmi
  Dropping jakarta-turbine-maven because of Exception java.lang.Exception: project 
"jdepend" not found processing project jakarta-turbine-maven
  
  I'll look into adding nag mails later.
  
  Revision  Changes    Path
  1.9       +1 -1      jakarta-alexandria/proposal/gump/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/build.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- build.xml 14 Jan 2002 14:05:38 -0000      1.8
  +++ build.xml 4 Mar 2002 08:08:18 -0000       1.9
  @@ -18,7 +18,7 @@
       <mkdir dir="classes"/>
       <mkdir dir="work"/>
       <javac srcdir="java" destdir="classes"/>
  -    <jar file="jenny.jar" basedir="classes"/>
  +    <jar destfile="jenny.jar" basedir="classes"/>
   
       <uptodate property="uptodate" targetfile="work/merge.xml">
         <srcfiles dir="." includes=".timestamp"/>
  
  
  
  1.13      +21 -1     jakarta-alexandria/proposal/gump/java/Jenny.java
  
  Index: Jenny.java
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/java/Jenny.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Jenny.java        27 Feb 2002 05:07:59 -0000      1.12
  +++ Jenny.java        4 Mar 2002 08:08:18 -0000       1.13
  @@ -142,7 +142,27 @@
          first = node.getFirstChild();
          for (Node child=first; child != null; child=child.getNextSibling()) {
              if (child.getNodeType()==Node.ELEMENT_NODE) {
  -               child=expand((Element)child);
  +               Element elem = (Element)child;
  +               try {
  +                   child=expand(elem);
  +               } catch (Throwable t) {
  +                   String tagName = elem.getTagName();
  +                   String nameAttr = elem.getAttribute("name");
  +                   String hrefAttr = elem.getAttribute("href");
  +
  +                   StringBuffer name = new StringBuffer(tagName);
  +                   if (!"".equals(nameAttr)) {
  +                       name.append(" with name ").append(nameAttr);
  +                   }
  +                   if (!"".equals(hrefAttr)) {
  +                       name.append(" with href ").append(hrefAttr);
  +                   }
  +                   
  +                   System.err.println("Failed to expand "
  +                                      + name.toString()
  +                                      + " because of exception "
  +                                      + t);
  +               }
              }
          }
   
  
  
  
  1.32      +18 -5     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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Project.java      3 Feb 2002 02:25:55 -0000       1.31
  +++ Project.java      4 Mar 2002 08:08:18 -0000       1.32
  @@ -31,18 +31,31 @@
        * @param elements list of &lt;project&gt; elements
        */
       public static void load(Enumeration elements) throws Exception {
  +        Element element = null;
           while (elements.hasMoreElements()) {
  -           new Project((Element)elements.nextElement());
  +            try {
  +                element = (Element)elements.nextElement();
  +                new Project(element);
  +            } catch (Throwable t) {
  +                System.err.println("Dropping "
  +                                   + element.getAttribute("name")
  +                                   + " because of Exception " + t);
  +            }
           }
  -
  +            
           // Resolve all references so that the XML can be processed in
           // one pass.
           for (Enumeration e=projects.elements(); e.hasMoreElements();) {
               Project p = ((Project)(e.nextElement()));
  -            p.expandDepends();
  -            p.resolveProperties();
  +            try {
  +                p.expandDepends();
  +                p.resolveProperties();
  +            } catch (Throwable t) {
  +                System.err.println("Dropping " + p.get("name")
  +                                   + " because of Exception " + t);
  +            }
           }
  -
  +        
           sort();
       }
   
  
  
  
  1.68      +1 -1      jakarta-alexandria/proposal/gump/profile/gump.xml
  
  Index: gump.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/proposal/gump/profile/gump.xml,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- gump.xml  3 Mar 2002 15:32:56 -0000       1.67
  +++ gump.xml  4 Mar 2002 08:08:18 -0000       1.68
  @@ -41,7 +41,7 @@
     <module href="project/jakarta-turbine-flux.xml"/>
     <module href="project/jakarta-turbine-fulcrum.xml"/>
     <module href="project/jakarta-turbine-jyve.xml"/>
  -  <!-- module 
href="http://cvs.apache.org/viewcvs/~checkout~/jakarta-turbine-maven/jakarta-turbine-maven.xml"/
 -->
  +  <module 
href="http://cvs.apache.org/viewcvs/~checkout~/jakarta-turbine-maven/jakarta-turbine-maven.xml"/>
     <module href="project/jakarta-turbine-orgami.xml"/>
     <module href="project/jakarta-turbine-site.xml"/>
     <module href="project/jakarta-turbine-stratum.xml"/>
  
  
  

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

Reply via email to