(no commit message)
authorErik Brakkee <erik@brakkee.org>
Thu, 16 Mar 2006 21:52:45 +0000 (21:52 +0000)
committerErik Brakkee <erik@brakkee.org>
Thu, 16 Mar 2006 21:52:45 +0000 (21:52 +0000)
build/checkstyle-noframes.xsl [new file with mode: 0644]
build/checkstyle-simple.xsl [new file with mode: 0644]
build/header.xml
build/style.xml
build/trailer.xml

diff --git a/build/checkstyle-noframes.xsl b/build/checkstyle-noframes.xsl
new file mode 100644 (file)
index 0000000..5f18134
--- /dev/null
@@ -0,0 +1,179 @@
+<xsl:stylesheet        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">\r
+<xsl:output method="html" indent="yes"/>\r
+<xsl:decimal-format decimal-separator="." grouping-separator="," />\r
+\r
+<!-- Checkstyle XML Style Sheet by Stephane Bailliez <sbailliez@apache.org>         -->\r
+<!-- Part of the Checkstyle distribution found at http://checkstyle.sourceforge.net -->\r
+<!-- Usage (generates checkstyle_report.html):                                      -->\r
+<!--    <checkstyle failonviolation="false" config="${check.config}">               -->\r
+<!--      <fileset dir="${src.dir}" includes="**/*.java"/>                          -->\r
+<!--      <formatter type="xml" toFile="${doc.dir}/checkstyle_report.xml"/>         -->\r
+<!--    </checkstyle>                                                               -->\r
+<!--    <style basedir="${doc.dir}" destdir="${doc.dir}"                            -->\r
+<!--            includes="checkstyle_report.xml"                                    -->\r
+<!--            style="${doc.dir}/checkstyle-noframes.xsl"/>                        -->\r
+\r
+<xsl:template match="checkstyle">\r
+       <html>\r
+               <head>\r
+               <style type="text/css">\r
+    .bannercell {\r
+      border: 0px;\r
+      padding: 0px;\r
+    }\r
+    body {\r
+      margin-left: 10;\r
+      margin-right: 10;\r
+      font:normal 80% arial,helvetica,sanserif;\r
+      background-color:#FFFFFF;\r
+      color:#000000;\r
+    }\r
+    .a td { \r
+      background: #efefef;\r
+    }\r
+    .b td { \r
+      background: #fff;\r
+    }\r
+    th, td {\r
+      text-align: left;\r
+      vertical-align: top;\r
+    }\r
+    th {\r
+      font-weight:bold;\r
+      background: #ccc;\r
+      color: black;\r
+    }\r
+    table, th, td {\r
+      font-size:100%;\r
+      border: none\r
+    }\r
+    table.log tr td, tr th {\r
+      \r
+    }\r
+    h2 {\r
+      font-weight:bold;\r
+      font-size:140%;\r
+      margin-bottom: 5;\r
+    }\r
+    h3 {\r
+      font-size:100%;\r
+      font-weight:bold;\r
+      background: #525D76;\r
+      color: white;\r
+      text-decoration: none;\r
+      padding: 5px;\r
+      margin-right: 2px;\r
+      margin-left: 2px;\r
+      margin-bottom: 0;\r
+    }\r
+               </style>\r
+               </head>\r
+               <body>\r
+                       <a name="top"></a>\r
+      <!-- jakarta logo -->\r
+      <table border="0" cellpadding="0" cellspacing="0" width="100%">\r
+      <tr>\r
+        <td class="bannercell" rowspan="2">\r
+          <!--a href="http://jakarta.apache.org/">\r
+          <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>\r
+          </a-->\r
+        </td>\r
+               <td class="text-align:right"><h2>CheckStyle Audit</h2></td>\r
+               </tr>\r
+               <tr>\r
+               <td class="text-align:right">Designed for use with <a href='http://checkstyle.sourceforge.net/'>CheckStyle</a> and <a href='http://jakarta.apache.org'>Ant</a>.</td>\r
+               </tr>\r
+      </table>\r
+       <hr size="1"/>\r
+                       \r
+                       <!-- Summary part -->\r
+                       <xsl:apply-templates select="." mode="summary"/>\r
+                       <hr size="1" width="100%" align="left"/>\r
+                       \r
+                       <!-- Package List part -->\r
+                       <xsl:apply-templates select="." mode="filelist"/>\r
+                       <hr size="1" width="100%" align="left"/>\r
+                       \r
+                       <!-- For each package create its part -->\r
+                       <xsl:for-each select="file">\r
+                         <xsl:sort select="@name"/>\r
+                         <xsl:apply-templates select="."/>\r
+                         <p/>\r
+                         <p/>\r
+                       </xsl:for-each>\r
+                       <hr size="1" width="100%" align="left"/>\r
+                       \r
+                       \r
+               </body>\r
+       </html>\r
+</xsl:template>\r
+       \r
+       \r
+       \r
+       <xsl:template match="checkstyle" mode="filelist">       \r
+               <h3>Files</h3>\r
+               <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">\r
+      <tr>\r
+        <th>Name</th>\r
+        <th>Errors</th>\r
+      </tr>\r
+                       <xsl:for-each select="file">\r
+                               <xsl:sort select="@name"/>\r
+                               <xsl:variable name="errorCount" select="count(error)"/>                         \r
+                               <tr>\r
+          <xsl:call-template name="alternated-row"/>\r
+                                       <td><a href="#f-{@name}"><xsl:value-of select="@name"/></a></td>\r
+                                       <td><xsl:value-of select="$errorCount"/></td>\r
+                               </tr>\r
+                       </xsl:for-each>\r
+               </table>                \r
+       </xsl:template>\r
+       \r
+       \r
+       <xsl:template match="file">\r
+    <a name="f-{@name}"></a>\r
+    <h3>File <xsl:value-of select="@name"/></h3>\r
+    \r
+    <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">\r
+       <tr>\r
+         <th>Error Description</th>\r
+         <th>Line</th>\r
+      </tr>\r
+      <xsl:for-each select="error">\r
+       <tr>\r
+        <xsl:call-template name="alternated-row"/>\r
+         <td><xsl:value-of select="@message"/></td>\r
+         <td><xsl:value-of select="@line"/></td>\r
+       </tr>\r
+       </xsl:for-each>\r
+    </table>\r
+    <a href="#top">Back to top</a>\r
+       </xsl:template>\r
+       \r
+       \r
+       <xsl:template match="checkstyle" mode="summary">\r
+               <h3>Summary</h3>\r
+               <xsl:variable name="fileCount" select="count(file)"/>\r
+               <xsl:variable name="errorCount" select="count(file/error)"/>\r
+               <table class="log" border="0" cellpadding="5" cellspacing="2" width="100%">\r
+               <tr>\r
+                       <th>Files</th>\r
+                       <th>Errors</th>\r
+               </tr>\r
+               <tr>\r
+                 <xsl:call-template name="alternated-row"/>\r
+                       <td><xsl:value-of select="$fileCount"/></td>\r
+                       <td><xsl:value-of select="$errorCount"/></td>\r
+               </tr>\r
+               </table>\r
+       </xsl:template>\r
+       \r
+  <xsl:template name="alternated-row">\r
+    <xsl:attribute name="class">\r
+      <xsl:if test="position() mod 2 = 1">a</xsl:if>\r
+      <xsl:if test="position() mod 2 = 0">b</xsl:if>\r
+    </xsl:attribute>  \r
+  </xsl:template>      \r
+</xsl:stylesheet>\r
+\r
+\r
diff --git a/build/checkstyle-simple.xsl b/build/checkstyle-simple.xsl
new file mode 100644 (file)
index 0000000..d98cbcb
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>\r
+\r
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\r
+\r
+<xsl:template match="/">\r
+  <html>\r
+    <head>\r
+    <title>Sun Coding Style Violations</title>\r
+    </head>\r
+    <body bgcolor="#FFFFEF">\r
+    <p><b>Coding Style Check Results</b></p>\r
+    <table border="1" cellspacing="0" cellpadding="2">\r
+       <tr bgcolor="#CC9966">\r
+           <th colspan="2"><b>Summary</b></th>\r
+       </tr>\r
+       <tr bgcolor="#CCF3D0">\r
+           <td>Total files checked</td>\r
+           <td><xsl:number level="any" value="count(descendant::file)"/></td>\r
+       </tr>\r
+       <tr bgcolor="#F3F3E1">\r
+           <td>Files with errors</td>\r
+           <td><xsl:number level="any" value="count(descendant::file[error])"/></td>\r
+       </tr>\r
+       <tr bgcolor="#CCF3D0">\r
+           <td>Total errors</td>\r
+           <td><xsl:number level="any" value="count(descendant::error)"/></td>\r
+       </tr>\r
+       <tr bgcolor="#F3F3E1">\r
+           <td>Errors per file</td>\r
+           <td><xsl:number level="any" value="count(descendant::error) div count(descendant::file)"/></td>\r
+       </tr>\r
+    </table>\r
+    <hr align="left" width="95%" size="1"/>\r
+    <p>The following are violations of the Sun Coding-Style Standards:</p>\r
+    <p/>\r
+       <xsl:apply-templates/>\r
+    </body>\r
+  </html>\r
+</xsl:template>\r
+\r
+<xsl:template match="file[error]">\r
+    <table bgcolor="#AFFFFF" width="95%" border="1" cellspacing="0" cellpadding="2">\r
+       <tr>\r
+           <th> File: </th>\r
+           <td>\r
+               <xsl:value-of select="@name"/>\r
+           </td>\r
+       </tr>\r
+    </table>\r
+    <table bgcolor="#DFFFFF" width="95%" border="1" cellspacing="0" cellpadding="2">\r
+       <tr>\r
+           <th> Line Number </th>\r
+           <th> Error Message </th>\r
+       </tr>\r
+       <xsl:apply-templates select="error"/>\r
+    </table>\r
+    <p/>\r
+</xsl:template>\r
+\r
+<xsl:template match="error">\r
+    <tr>\r
+       <td>\r
+           <xsl:value-of select="@line"/>\r
+       </td>\r
+       <td>\r
+           <xsl:value-of select="@message"/>\r
+       </td>\r
+    </tr>\r
+</xsl:template>\r
+\r
+</xsl:stylesheet>\r
index df55a859ef4eb327a19cb794aaafeff8e53ded85..fe98f0a0f7d87c7797423bffe7a0b52d82303d56 100644 (file)
   </copy>
 </target>
 
-<property name="crawler.dist.dir" value="${lib.dir}/crawler"/>
+<property name="crawler.dist.dir" value="${lib.dir}/crawler/basic"/>
 <target name="wamblee.crawler.d">
   <copy todir="${download.dir}">
     <fileset dir="${crawler.dist.dir}">
-      <include name="crawler.jar"/>
+      <include name="crawler-basic.jar"/>
     </fileset>
   </copy>
 </target>
 <target name="wamblee.crawler.test.d">
   <copy todir="${download.dir}">
     <fileset dir="${crawler.dist.dir}">
-      <include name="crawler-test.jar"/>
+      <include name="crawler-basic-test.jar"/>
     </fileset>
   </copy>
 </target>
         <property name="module.emmareport.dir"
                value="${module.report.dir}/html/emma"/>
        <property name="module.docbase.dir"
-               value="${module.build.dir}/javadoc" />
+               value="${module.build.dir}/docs" />
        <property name="module.javadoc.dir"
                value="${module.docbase.dir}/api" />
        <property name="module.javadocjar.name"
                value="${module.docbase.dir}/pdf" />
        <property name="module.doccheck.dir"
                value="${module.docbase.dir}/doccheck" />
+       <property name="module.checkstyle.dir"
+           value="${module.docbase.dir}/checkstyle" />
        <property name="module.jar.name" value="${module.name}.jar" />
        
        <!--  Replace the dash by a / to create a relative directory 
index ecbd3acf2cae1b5c51767782c08971e6c914e4cd..58b854ea9ed749c0cb82ba79b381c2802e0d8616 100644 (file)
 \r
         <!-- Checks for blocks. You know, those {}'s         -->\r
         <!-- See http://checkstyle.sf.net/config_blocks.html -->\r
-        <module name="AvoidNestedBlocks"/>\r
+        <module name="AvoidNestedBlocks">
+            <property name="allowInSwitchCase" value="true"/>
+        </module>\r
         <module name="EmptyBlock"/>\r
         <module name="LeftCurly"/>\r
         <module name="NeedBraces"/>\r
         <module name="HiddenField"/>\r
         <module name="IllegalInstantiation"/>\r
         <module name="InnerAssignment"/>\r
-        <module name="MagicNumber"/>\r
+        <module name="MagicNumber">
+            <property name="ignoreNumbers" value="-1,0,1,2,3,4"/>
+        </module>\r
         <module name="MissingSwitchDefault"/>\r
         <module name="RedundantThrows"/>\r
         <module name="SimplifyBooleanExpression"/>\r
         <module name="SimplifyBooleanReturn"/>\r
-        <module name="ExplicitInitialization"/>\r
+        <!-- module name="ExplicitInitialization"/ -->\r
 \r
         <!-- Checks for class design                         -->\r
         <!-- See http://checkstyle.sf.net/config_design.html -->\r
index a57b7da32c38c10f7affaaefb5b0008028a4e7c5..a5a86335850a471b8a95f810d4665beef7a3b86a 100644 (file)
        Check style, 
        ============================================================================ -->
 
-<target name="checkstyle" depends="testclasses">
-       <checkstyle config="${build.dir}/${checkstyle.rules}"
-               failOnViolation="false">
-               <classpath>
-                 <path refid="module.build.path"/>
-               </classpath>
-               <fileset dir="${module.source.dir}" includes="**/*.java" />
-               <formatter type="plain" />
-       </checkstyle>
-       <checkstyle config="${build.dir}/${checkstyle.rules}"
+<target name="checkstyle-impl">
+   <checkstyle config="${build.dir}/${checkstyle.rules}"
                failOnViolation="false">
                <classpath>
-                 <pathelement path="${module.testbuild.path}"/>
+                 <pathelement path="${checkstyle.classpath}"/>
                </classpath>
-               <fileset dir="${module.test.dir}" includes="**/*.java" />
-               <formatter type="plain" />
+               <fileset dir="${checkstyle.srcdir}" includes="**/*.java"/>
+               <formatter type="xml" tofile="${module.checkstyle.dir}/${checkstyle.report}.xml"/>
        </checkstyle>
+       <style style="${build.dir}/checkstyle-simple.xsl"
+                  in="${module.checkstyle.dir}/${checkstyle.report}.xml"
+                  out="${module.checkstyle.dir}/${checkstyle.report}.html"/>
+       <echo>Results are available at ${module.checkstyle.dir}/${checkstyle.report}.html</echo>
+</target>
+
+<target name="checkstyle" depends="testclasses">
+    <mkdir dir="${module.checkstyle.dir}"/>
+       <antcall target="checkstyle-impl">
+         <param name="checkstyle.classpath" refid="module.build.path"/>
+         <param name="checkstyle.srcdir" value="${module.source.dir}"/>
+         <param name="checkstyle.report" value="source-results"/>
+       </antcall>
+       <antcall target="checkstyle-impl">
+         <param name="checkstyle.classpath" refid="module.testbuild.path"/>
+         <param name="checkstyle.srcdir" value="${module.test.dir}"/>
+         <param name="checkstyle.report" value="test-results"/>
+       </antcall>
 </target>
 
 <!-- ============================================================================