forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@apache.org
Subject cvs commit: xml-forrest/src/targets project.xtarget
Date Thu, 04 Jul 2002 10:02:31 GMT
stevenn     2002/07/04 03:02:30

  Modified:    src/targets project.xtarget
  Added:       src/resources/library/xslt show-ant-dependencies.xsl
  Log:
  added ant dependency chain visualizer
  
  Revision  Changes    Path
  1.1                  xml-forrest/src/resources/library/xslt/show-ant-dependencies.xsl
  
  Index: show-ant-dependencies.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:output indent="yes"/>
  
  <xsl:key name="targets-names" match="target" use="@name"/>
  
  <xsl:template match="/">
    <html>
      <head>
        <title>Ant/Centipede target dependency chain</title>
      </head>
      <body>
        <ul>
      	  <xsl:apply-templates select="project/target">
            <xsl:sort select="@name"/>
          </xsl:apply-templates>
        </ul>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="target">
    <li><xsl:value-of select="@name"/></li>
    <xsl:if test="@depends | antcall">
      <ul>
        <xsl:if test="string-length(@depends) &gt; 1">
          <li>depends:
            <ul>
              <xsl:call-template name="process-depends-attrs">
                <xsl:with-param name="depends-string" select="@depends"/>
              </xsl:call-template>
            </ul>
          </li>
        </xsl:if>
        <xsl:if test="antcall">
          <li>calls:
            <xsl:variable name="calltarget" select="antcall/@target"/>
            <ul>
              <xsl:for-each select="key('targets-names',$calltarget)">
                <xsl:apply-templates select="."/>
              </xsl:for-each>
            </ul>
          </li>
        </xsl:if>
      </ul>
    </xsl:if>
  </xsl:template>
  
  <xsl:template name="process-depends-attrs">
    <xsl:param name="depends-string"/>
    <xsl:choose>
      <xsl:when test="contains($depends-string,',')">
        <xsl:variable name="substr" select="substring-before(normalize-space($depends-string),',')"/>
        <xsl:variable name="remains" select="normalize-space(substring-after(normalize-space($depends-string),concat($substr,',')))"/>
        <xsl:apply-templates select="key('targets-names',$substr)"/>
        <xsl:if test="string-length($remains) &gt; 1">
          <xsl:call-template name="process-depends-attrs">
            <xsl:with-param name="depends-string" select="$remains"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:when>
      <xsl:otherwise>
        <xsl:apply-templates select="key('targets-names',$depends-string)"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  
  </xsl:stylesheet><!-- Stylesheet edited using Stylus Studio - (c)1998-2002 eXcelon
Corp. -->
  
  
  1.41      +10 -6     xml-forrest/src/targets/project.xtarget
  
  Index: project.xtarget
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/targets/project.xtarget,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- project.xtarget	20 Jun 2002 10:13:45 -0000	1.40
  +++ project.xtarget	4 Jul 2002 10:02:30 -0000	1.41
  @@ -367,21 +367,25 @@
       </antcall>
   
     </target>
  -  
  +
   
   
      <target name="forrestbar" depends="init">
  -   
  +
         <mkdir dir="${build.dir}" />
         <mkdir dir="${build.dir}/work/forrestbar" />
  -         
  +
         <jar jarfile="${build.dir}/work/forrestbar/forrestbar.jar">
            <fileset dir="src/resources/forrestbar" includes="content/**/*" />
         </jar>
  -         
  +
         <copy file="src/resources/forrestbar/install.js" todir="${build.dir}/work/forrestbar"
overwrite="true" />
   
         <zip zipfile="${build.dir}/forrestbar.xpi" basedir="${build.dir}/work/forrestbar"
/>
  -      
  +
      </target>
  -  
  +
  +   <target name="dependencies" depends="init">
  +      <mkdir dir="${build.dir}" />
  +      <style in="build.xml" out="${build.dir}/ant-dependencies.html" style="src/resources/library/xslt/show-ant-dependencies.xsl"/>
  +   </target>
  \ No newline at end of file
  
  
  

Mime
View raw message