Author: ajaquith
Date: Thu Jul 3 17:09:53 2008
New Revision: 673882
URL: http://svn.apache.org/viewvc?rev=673882&view=rev
Log:
Added Ant target 'api-diff' which allows arbitrary diffing against previous
JSPWiki.jar artifacts. It prints a nicely formatted HTML page describing public
API differences. The report file is tests/reports/API-changes.html.
Added:
incubator/jspwiki/trunk/tests/etc/DiffToHTML.xsl
incubator/jspwiki/trunk/tests/etc/dependencyfindertasks.properties
incubator/jspwiki/trunk/tests/etc/log4j.properties
Added: incubator/jspwiki/trunk/tests/etc/DiffToHTML.xsl
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/etc/DiffToHTML.xsl?rev=673882&view=auto
==============================================================================
--- incubator/jspwiki/trunk/tests/etc/DiffToHTML.xsl (added)
+++ incubator/jspwiki/trunk/tests/etc/DiffToHTML.xsl Thu Jul 3 17:09:53 2008
@@ -0,0 +1,307 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright (c) 2001-2007, Jean Tessier
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of Jean Tessier nor the names of his contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output method="html" indent="yes"/>
+ <xsl:strip-space elements="*"/>
+
+ <xsl:template match="differences">
+ <xsl:variable name="new-label" select="new"/>
+
+ <html>
+
+ <head>
+ <title><xsl:if test="name/text()"><xsl:value-of select="name"/> -
</xsl:if>API Change History</title>
+ </head>
+
+ <body bgcolor="#ffffff">
+
+ <h1><xsl:if test="name/text()"><xsl:value-of select="name"/> -
</xsl:if>API Change History</h1>
+
+ <ul>
+ <li><a href="#{$new-label}"><xsl:value-of select="old"/> to
<xsl:value-of select="new"/></a></li>
+ </ul>
+
+ <hr />
+
+ <a name="{$new-label}" />
+ <h2><xsl:value-of select="old"/> to <xsl:value-of select="new"/></h2>
+
+ <xsl:apply-templates/>
+
+ <hr />
+
+ </body>
+
+ </html>
+ </xsl:template>
+
+ <xsl:template match="differences/name | old | new"></xsl:template>
+
+ <xsl:template match="removed-packages">
+ <h3>Removed Packages:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="removed-interfaces">
+ <h3>Removed Interfaces:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="removed-classes">
+ <h3>Removed Classes:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="deprecated-interfaces">
+ <h3>Newly Deprecated Interfaces:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="deprecated-classes">
+ <h3>Newly Deprecated Classes:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="modified-interfaces">
+ <h3>Modified Interfaces:</h3>
+ <blockquote>
+ <xsl:apply-templates/>
+ </blockquote>
+ </xsl:template>
+
+ <xsl:template match="modified-classes">
+ <h3>Modified Classes:</h3>
+ <blockquote>
+ <xsl:apply-templates/>
+ </blockquote>
+ </xsl:template>
+
+ <xsl:template match="undeprecated-interfaces">
+ <h3>Formerly Deprecated Interfaces:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="undeprecated-classes">
+ <h3>Formerly Deprecated Classes:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="new-packages">
+ <h3>New Packages:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="new-interfaces">
+ <h3>New Interfaces:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="new-classes">
+ <h3>New Classes:</h3>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="class">
+ <h4><code><xsl:value-of select="name"/></code></h4>
+ <blockquote>
+ <xsl:apply-templates/>
+ </blockquote>
+ </xsl:template>
+
+ <xsl:template match="removed-fields">
+ <h5>Removed Fields:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="removed-constructors">
+ <h5>Removed Constructors:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="removed-methods">
+ <h5>Removed Methods:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="deprecated-fields">
+ <h5>Newly Deprecated Fields:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="deprecated-constructors">
+ <h5>Newly Deprecated Constructors:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="deprecated-methods">
+ <h5>Newly Deprecated Methods:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="modified-fields">
+ <h5>Field Declaration Changes:</h5>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="modified-constructors">
+ <h5>Constructor Changes:</h5>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="modified-methods">
+ <h5>Method Changes:</h5>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="feature">
+ <blockquote>
+ <p><nobr><code>
+ <xsl:apply-templates/>
+ </code></nobr></p>
+ </blockquote>
+ </xsl:template>
+
+ <xsl:template match="modified-code">
+ <b>code:</b> <xsl:value-of select="."/>
+ </xsl:template>
+
+ <xsl:template match="modified-declaration">
+ <b>old:</b> <xsl:value-of select="old-declaration"/>
+ <xsl:if test="[EMAIL PROTECTED]'yes']"> <b>[deprecated]</b></xsl:if>
+ <br/>
+ <b>new:</b> <xsl:value-of select="new-declaration"/>
+ <xsl:if test="[EMAIL PROTECTED]'yes']"> <b>[deprecated]</b></xsl:if>
+ <xsl:if test="../modified-code"><br/></xsl:if>
+ </xsl:template>
+
+ <xsl:template match="undeprecated-fields">
+ <h5>Formerly Deprecated Fields:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="undeprecated-constructors">
+ <h5>Formerly Deprecated Constructors:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="undeprecated-methods">
+ <h5>Formerly Deprecated Methods:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="new-fields">
+ <h5>New Fields:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="new-constructors">
+ <h5>New Constructors:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="new-methods">
+ <h5>New Methods:</h5>
+ <ul>
+ <xsl:apply-templates/>
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="class/name | feature/name"></xsl:template>
+
+ <xsl:template match="class/modified-declaration">
+ <h5>Declaration Changes:</h5>
+ <blockquote>
+ <p><nobr><code>
+ <b>old:</b> <xsl:value-of select="old-declaration"/>
+ <xsl:if test="[EMAIL PROTECTED]'yes']"> <b>[deprecated]</b></xsl:if>
+ <br/>
+ <b>new:</b> <xsl:value-of select="new-declaration"/>
+ <xsl:if test="[EMAIL PROTECTED]'yes']"> <b>[deprecated]</b></xsl:if>
+ </code></nobr></p>
+ </blockquote>
+ </xsl:template>
+
+ <xsl:template match="new-packages/[EMAIL PROTECTED]'yes'] |
new-interfaces/[EMAIL PROTECTED]'yes'] | new-classes/[EMAIL PROTECTED]'yes'] |
new-fields/[EMAIL PROTECTED]'yes'] | new-constructors/[EMAIL PROTECTED]'yes'] |
new-methods/[EMAIL PROTECTED]'yes']">
+ <li><nobr><code><xsl:value-of select="."/>
<b>[deprecated]</b></code></nobr></li>
+ </xsl:template>
+
+ <xsl:template match="name | declaration">
+ <li><nobr><code><xsl:value-of select="."/></code></nobr></li>
+ </xsl:template>
+
+</xsl:stylesheet>
Added: incubator/jspwiki/trunk/tests/etc/dependencyfindertasks.properties
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/etc/dependencyfindertasks.properties?rev=673882&view=auto
==============================================================================
--- incubator/jspwiki/trunk/tests/etc/dependencyfindertasks.properties (added)
+++ incubator/jspwiki/trunk/tests/etc/dependencyfindertasks.properties Thu Jul
3 17:09:53 2008
@@ -0,0 +1,11 @@
+classmetrics=com.jeantessier.dependencyfinder.ant.ClassMetrics
+dependencycycles=com.jeantessier.dependencyfinder.ant.DependencyCycles
+dependencyclosure=com.jeantessier.dependencyfinder.ant.DependencyClosure
+dependencyextractor=com.jeantessier.dependencyfinder.ant.DependencyExtractor
+dependencymetrics=com.jeantessier.dependencyfinder.ant.DependencyMetrics
+dependencyreporter=com.jeantessier.dependencyfinder.ant.DependencyReporter
+jarjardiff=com.jeantessier.dependencyfinder.ant.JarJarDiff
+listdeprecatedelements=com.jeantessier.dependencyfinder.ant.ListDeprecatedElements
+listdiff=com.jeantessier.dependencyfinder.ant.ListDiff
+listsymbols=com.jeantessier.dependencyfinder.ant.ListSymbols
+oometrics=com.jeantessier.dependencyfinder.ant.OOMetrics
Added: incubator/jspwiki/trunk/tests/etc/log4j.properties
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/etc/log4j.properties?rev=673882&view=auto
==============================================================================
--- incubator/jspwiki/trunk/tests/etc/log4j.properties (added)
+++ incubator/jspwiki/trunk/tests/etc/log4j.properties Thu Jul 3 17:09:53 2008
@@ -0,0 +1,20 @@
+# Default logging settings for Dependency Finder applications
+log4j.rootLogger=ERROR, CONSOLE
+
+# log4j.logger.com.jeantessier.dependency=DEBUG, CHAINSAW
+# log4j.logger.com.jeantessier.dependency.PackageNode=DEBUG, CHAINSAW
+# log4j.logger.com.jeantessier.metrics.MetricsGatherer=DEBUG, CHAINSAW
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=[%d{yyyy/MM/dd HH:mm:ss.SSS}]
%c{2} %m%n
+
+log4j.appender.FILE=org.apache.log4j.FileAppender
+log4j.appender.FILE.File=C:\\language\\Java\\myprojects\\DependencyFinder\\logs\\default.log
+log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.FILE.layout.ConversionPattern=[%d{yyyy/MM/dd HH:mm:ss.SSS}]
%c{2} %m%n
+
+log4j.appender.CHAINSAW=org.apache.log4j.net.SocketAppender
+log4j.appender.CHAINSAW.RemoteHost=localhost
+log4j.appender.CHAINSAW.Port=4445
+log4j.appender.CHAINSAW.LocationInfo=true