You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by bw...@apache.org on 2003/02/02 03:08:46 UTC

cvs commit: jakarta-turbine-maven/src/plugins-build/jdepend/src/plugin-resources jdepend.jsl

bwalding    2003/02/01 18:08:46

  Modified:    src/plugins-build/jdepend/src/plugin-resources jdepend.jsl
  Log:
  MAVEN-239: Once the patches for JDepend go through, there will be a new attribute
  on Class items - sourceFile.  This patch lets the report understand and more correctly report
  with the new attributes. (link to xref for inner classes is more correct).
  
  Revision  Changes    Path
  1.2       +18 -3     jakarta-turbine-maven/src/plugins-build/jdepend/src/plugin-resources/jdepend.jsl
  
  Index: jdepend.jsl
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/jdepend/src/plugin-resources/jdepend.jsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jdepend.jsl	24 Jan 2003 03:45:35 -0000	1.1
  +++ jdepend.jsl	2 Feb 2003 02:08:46 -0000	1.2
  @@ -16,6 +16,7 @@
     <j:useBean var="htmlescape" class="org.apache.velocity.anakia.Escape"/>
     <j:useBean var="fileutil" class="org.apache.velocity.texen.util.FileUtil"/>
     <j:useBean var="pathtool" class="org.apache.maven.DVSLPathTool"/>
  +  <j:useBean var="stringTool" class="org.apache.maven.StringTool"/>
   
     <define:taglib uri="jdepend">
       <define:tag name="nav">
  @@ -44,9 +45,23 @@
           </j:when>
           <j:otherwise>
             <j:forEach var="class" items="${currentNode.selectNodes(xpath)}">
  -            <j:set var="index" value="${class.getStringValue().lastIndexOf('.') + 1}"/>
  -            <util:replace var="dir" oldChar="." newChar="/" value="${class.getStringValue()}"/>
  -            <a href="xref/${dir}.html">${class.getStringValue().substring(mavenTool.toInteger(index.toString()))}</a>
  +            <!-- class.StringValue =~ org.apache.maven.SomeClass -->
  +            <j:set var="packageName" value="${stringTool.splitStringAtLastDelim(class.StringValue, '.').get(0)}"/>
  +            <j:set var="className" value="${stringTool.splitStringAtLastDelim(class.StringValue, '.').get(1)}"/>
  +            <util:replace var="dir" oldChar="." newChar="/" value="${packageName}"/>
  +            
  +            <j:choose>
  +		      <j:when test="${class.attribute('sourceFile') != null}">
  +	            <j:set var="classSourceFile" value="${class.attribute('sourceFile').getValue()}"/>
  +	            <j:set var="classSourceFile" value="${stringTool.splitStringAtLastDelim(classSourceFile, '.').get(0)}"/>
  +	            
  +                <a href="xref/${dir}/${classSourceFile}.html">${className}</a>
  +              </j:when>
  +              <j:otherwise>
  +            	<a href="xref/${dir}/${className}.html">${className}</a>
  +              </j:otherwise>
  +            </j:choose>
  +          
               <br/>
             </j:forEach>
           </j:otherwise>