From: <rpe...@us...> - 2009-02-23 22:46:05
|
Revision: 813 http://xradar.svn.sourceforge.net/xradar/?rev=813&view=rev Author: rpelisse Date: 2009-02-23 22:46:01 +0000 (Mon, 23 Feb 2009) Log Message: ----------- If we do not have a jdepend report, we check if we got a classes directory, and in this case, we run jdepend ourself to get our backbone file... Modified Paths: -------------- trunk/xradar/src/main/java/org/sourceforge/xradar/statics/Statics.java Modified: trunk/xradar/src/main/java/org/sourceforge/xradar/statics/Statics.java =================================================================== --- trunk/xradar/src/main/java/org/sourceforge/xradar/statics/Statics.java 2009-02-23 22:45:31 UTC (rev 812) +++ trunk/xradar/src/main/java/org/sourceforge/xradar/statics/Statics.java 2009-02-23 22:46:01 UTC (rev 813) @@ -77,7 +77,23 @@ private String normalizedReport; private String masterReport; + private String classesDirectory; // Only required if there is no 'jdepend' report to build the backbone file on top of it + + /** + * @return the classesDirectory + */ + public String getClassesDirectory() { + return classesDirectory; + } + + /** + * @param classesDirectory the classesDirectory to set + */ + public void setClassesDirectory(String classesDirectory) { + this.classesDirectory = classesDirectory; + } + private boolean unitTest = false; public Statics() @@ -185,14 +201,29 @@ * @throws FileNotFoundException * @throws MalformedURLException * @throws IOException + * @throws XRadarException */ - public String executeMerge() throws FileNotFoundException, MalformedURLException, IOException { + public String executeMerge() throws FileNotFoundException, MalformedURLException, IOException, XRadarException { // Setting the debug level if ( this.isDebug() ) Statics.logger.setLevel(Level.FINEST); // First merge all the report StringWriter currentResult = null; + // Do we have a JDepent report ? + int backboneReportOrderId = getDefaultIntValue("Statics.defaultOrderId.jdepend"); + if ( this.getClassesDirectory() != null && ! "".equals(this.getClassesDirectory()) && // if we have no classes directory, no way around JDepend ! + backboneReportOrderId > 0 && + this.reportsToMerge.contains( new Report( backboneReportOrderId) ) ) { + String reportFilename = this.getDocsHome() + "backbonefile.xml"; + File backboneReport = new File(this.getDocsHome() + "backbonefile.xml"); + if ( ! MergeFileBackboneCreator.createBackBoneFile( new File(this.getClassesDirectory()), backboneReport) ) + throw new XRadarException("No jdepend report provided to build on and the classes directory provided " + this.getClassesDirectory() + " does not seems to exist"); + else + this.reportsToMerge.add(new Report("jdepend",reportFilename)); + } + + // No let prepare the reports for ( Report report : this.reportsToMerge ) { if ( this.isDebug() ) @@ -399,7 +430,7 @@ processStep(new InputSource(inputXml),stylesheet,preambule,outputFilename); } - + /* * Commodity method that regroup a generic version of all the preparation works * to do before executing one of post process task. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |