buildframework/helium/tools/common/java/src/com/nokia/ant/BuildStatusDef.java
changeset 179 d8ac696cc51f
parent 1 be27ed110b50
equal deleted inserted replaced
1:be27ed110b50 179:d8ac696cc51f
    65         }
    65         }
    66         checkTargetsProperties(project);
    66         checkTargetsProperties(project);
    67         
    67         
    68         if (!output.isEmpty())
    68         if (!output.isEmpty())
    69         {
    69         {
    70             System.out.println("*** Configuration report ***");
    70             log("*** Configuration report ***", Project.MSG_INFO);
    71             for (String x : output)
    71             for (String x : output)
    72                 System.out.println(x);
    72                 log(x, Project.MSG_INFO);
    73         }
    73         }
    74     }
    74     }
    75     
    75     
    76         /**
    76         /**
    77      * @param desiredTarget
    77      * @param desiredTarget
   141                 String[] array = { depTargetString };
   141                 String[] array = { depTargetString };
   142                 try {
   142                 try {
   143                 Target depTarget = findTarget(depTargetString, project, array);
   143                 Target depTarget = findTarget(depTargetString, project, array);
   144                 targetCallsHeliumTarget(depTarget, project);
   144                 targetCallsHeliumTarget(depTarget, project);
   145                 } catch (BuildException x) { 
   145                 } catch (BuildException x) { 
       
   146                     // We are Ignoring the errors as no need to fail the build.
       
   147                     log("Exception occured while target defined outside helium are calling a private Helium target " + x.toString(), Project.MSG_DEBUG);
   146                     x = null;
   148                     x = null;
   147                     }
   149                     }
   148             }
   150             }
   149             
   151             
   150           
   152           
   153                 String depTargetString = (String) e.nextElement();
   155                 String depTargetString = (String) e.nextElement();
   154                 String[] array = { depTargetString };
   156                 String[] array = { depTargetString };
   155                 try {
   157                 try {
   156                 Target depTarget = findTarget(depTargetString, project, array);
   158                 Target depTarget = findTarget(depTargetString, project, array);
   157                 targetCallsHeliumTarget(depTarget, project);
   159                 targetCallsHeliumTarget(depTarget, project);
   158                 } catch (BuildException x) { 
   160                 } catch (BuildException x) {
       
   161                     //We are Ignoring the errors as no need to fail the build.
       
   162                     log("Exception occured while target defined outside helium are calling a private Helium target " + x.toString(), Project.MSG_DEBUG);
   159                     x = null;
   163                     x = null;
   160                     }
   164                     }
   161             }
   165             }
   162         }
   166         }
   163         else
   167         else
   164         {
   168         {
   165             checkIfTargetPrivate(target, project);
   169             checkIfTargetPrivate(target, project);
   166         }
   170         }
   167 
   171 
   168         } catch (Exception e) { e.printStackTrace(); }
   172         } catch (Exception e) {
       
   173             //We are Ignoring the errors as no need to fail the build.
       
   174             log("Exception occured while target defined outside helium are calling a private Helium target " + e.getMessage(), Project.MSG_DEBUG);
       
   175             e.printStackTrace();
       
   176         }
   169     }
   177     }
   170 
   178 
   171     private class AntTargetVisitor extends VisitorSupport
   179     private class AntTargetVisitor extends VisitorSupport
   172     {
   180     {
   173         private List targetList;
   181         private List targetList;
   210         String location = target.getLocation().getFileName();
   218         String location = target.getLocation().getFileName();
   211         
   219         
   212         try {
   220         try {
   213         File file = new File(location);
   221         File file = new File(location);
   214         antDoc = xmlReader.read(file);
   222         antDoc = xmlReader.read(file);
   215         } catch (Exception e) { e.printStackTrace(); }
   223         } catch (Exception e) {
       
   224             // We are Ignoring the errors as no need to fail the build.
       
   225             log("Not able read the XML file. " + e.getMessage(), Project.MSG_WARN);
       
   226         }
   216           
   227           
   217         String projectName = antDoc.valueOf("/project/@name");
   228         String projectName = antDoc.valueOf("/project/@name");
   218         for (Iterator iterator = antDoc.selectNodes("//target").iterator(); iterator.hasNext();)
   229         for (Iterator iterator = antDoc.selectNodes("//target").iterator(); iterator.hasNext();)
   219         {
   230         {
   220             Element e = (Element) iterator.next();
   231             Element e = (Element) iterator.next();
   281             ArrayList customerProps = getCustomerProperties(project);
   292             ArrayList customerProps = getCustomerProperties(project);
   282             
   293             
   283             try {
   294             try {
   284             File model = new File(project.getProperty("data.model.file"));
   295             File model = new File(project.getProperty("data.model.file"));
   285             antDoc = xmlReader.read(model);
   296             antDoc = xmlReader.read(model);
   286             } catch (Exception e) { e.printStackTrace(); }
   297             } catch (Exception e) {
       
   298                 // We are Ignoring the errors as no need to fail the build.
       
   299                 log("Not able read the data model file. " + e.getMessage(), Project.MSG_WARN);
       
   300             }
   287             
   301             
   288             List<Node> statements = antDoc.selectNodes("//property");
   302             List<Node> statements = antDoc.selectNodes("//property");
   289             
   303             
   290             for (Node statement : statements)
   304             for (Node statement : statements)
   291             {
   305             {
   324                     String propertyName = propertyNode.attributeValue("name");
   338                     String propertyName = propertyNode.attributeValue("name");
   325                     props.add(propertyName);
   339                     props.add(propertyName);
   326                 }
   340                 }
   327             }
   341             }
   328         }
   342         }
   329         } catch (Exception e) { e.printStackTrace(); }
   343         } catch (Exception e) {
       
   344             // We are Ignoring the errors as no need to fail the build.
       
   345             log("Not able read the Customer Properties " + e.getMessage(), Project.MSG_WARN);
       
   346         }
   330           
   347           
   331         return props;
   348         return props;
   332     }
   349     }
   333     
   350     
   334 }
   351 }