jvanzyl 2002/07/14 12:39:54
Added: src/plugins-build/activity developer-activity.dvsl
file-activity.dvsl maven.xml plugin.jelly
plugin.properties project.properties project.xml
toolbox.props
Log:
o Re-adding the activity plugin.
Revision Changes Path
1.1
jakarta-turbine-maven/src/plugins-build/activity/developer-activity.dvsl
Index: developer-activity.dvsl
===================================================================
#######################################################################
## Developer Activity D V S L S T Y L E S H E E T ##
#######################################################################
## This stylesheet is used to transform the output of ChangeLog's xml
## generator. The XML is transformed into a standard xdoc that can
## then be transformed (yet again) using whatever stylesheet is used
## to format one's site.
##
##
## Version: $Id: developer-activity.dvsl,v 1.1 2002/07/14 19:39:54 jvanzyl Exp $
## Author: dIon Gillard
#######################################################################
## T E M P L A T E D E F I N I T I O N S ##
#######################################################################
## Matches the first data element of the ChangeLog XML report.
##
#match ("changelog")
<?xml version="1.0"?>
<document>
<properties>
<title>Developer Activity Analysis</title>
</properties>
<body>
<section name="Activity by Developer">
<p>
Timeframe: $context.toolbox.range days,
Total Commits: $node.valueOf("count(./changelog-entry"),
Total Number of Files Changed: $node.valueOf("count(./changelog-entry/file")
</p>
<table>
<tr>
<th>Name</th><th>Number of Commits</th><th>Number of files changed</th>
</tr>
#foreach ($developer in
$node.selectNodes("document('$context.toolbox.basedir/project.xml')/project/developers/developer"))
<tr>
#set ($name = $developer.name.value())
<td>$name</td>
#set ($commits = 0)
#set ($commits =
$node.valueOf("count(./changelog-entry/author[text()='$developer.name.value()']"))
<td>$commits</td>
#set ($changedFiles = 0)
#set ($changedFiles =
$node.valueOf("count(./changelog-entry/author[text()='$developer.name.value()']/../file"))
<td>$changedFiles</td>
</tr>
#end
</table>
</section>
</body></document>
#end
1.1
jakarta-turbine-maven/src/plugins-build/activity/file-activity.dvsl
Index: file-activity.dvsl
===================================================================
#######################################################################
## Developer Activity D V S L S T Y L E S H E E T ##
#######################################################################
## This stylesheet is used to transform the output of ChangeLog's xml
## generator. The XML is transformed into a standard xdoc that can
## then be transformed (yet again) using whatever stylesheet is used
## to format one's site.
##
##
## Version: $Id: file-activity.dvsl,v 1.1 2002/07/14 19:39:54 jvanzyl Exp $
## Author: dIon Gillard
#######################################################################
## V E L O C I T Y M A C R O S ##
#######################################################################
## Convert a string that represents a number using the specified
## pattern.
##
#macro (cvsWebLink $pom $file)
<a href="$pom.repository.url.toString().trim()$file">$file</a>
#end
#######################################################################
## T E M P L A T E D E F I N I T I O N S ##
#######################################################################
## Matches the first data element of the ChangeLog XML report.
##
#match ("changelog")
<?xml version="1.0"?>
## Grab a reference to the project descriptor here so we can pull
## info from it such as the cvs web url, etc ...
#set( $pomFilename = "$context.toolbox.basedir/project.xml")
#set( $pom = $node.selectSingleNode("document('$pomFilename')/project"))
$context.applyTemplates()
<document>
<properties>
<title>File Activity Analysis</title>
</properties>
<body>
<section name="Activity by File">
<p>
Timeframe: $context.toolbox.range days,
Total Commits: $node.valueOf("count(./changelog-entry"),
Total Number of Files Changed: $node.valueOf("count(./changelog-entry/file")
</p>
<table>
<tr>
<th>File Name</th><th>Number of times changed</th>
</tr>
#set ($fileList = $context.toolbox.maven.CountDescending)
#foreach ($key in $fileList.keySet())
#foreach ($name in $fileList.get($key))
<tr>
<td>#cvsWebLink ($pom $name)</td>
<td>$key</td>
</tr>
#end
#end
</table>
</section>
</body></document>
#end
#match("file")
#set ($dummy = $context.toolbox.maven.addToCount("$node.name.value()"))
#end
1.1 jakarta-turbine-maven/src/plugins-build/activity/maven.xml
Index: maven.xml
===================================================================
<project default="plugin"
xmlns:j="jelly:core"
xmlns:m="maven">
<goal
name="plugin">
<j:if test="${sourcesPresent == 'true'}">
<attainGoal name="java:jar"/>
</j:if>
<property name="assemblyDir" value="target/assemblyDir"/>
<mkdir dir="target/assemblyDir"/>
<copy todir="${assemblyDir}" flatten="true">
<fileset dir=".">
<include name="target/${maven.final.name}.jar"/>
</fileset>
</copy>
<copy todir="${assemblyDir}">
<fileset dir=".">
<exclude name="target/**"/>
<exclude name="src/**"/>
</fileset>
</copy>
<jar
jarfile="${maven.build.dir}/${maven.final.name}-plugin.jar">
<fileset dir="${assemblyDir}"/>
</jar>
</goal>
</project>
1.1 jakarta-turbine-maven/src/plugins-build/activity/plugin.jelly
Index: plugin.jelly
===================================================================
<?xml version="1.0"?>
<project xmlns:j="jelly:core">
<!-- ================================================================== -->
<!-- C V S A C T I V I T Y R E P O R T -->
<!-- ================================================================== -->
<taskdef
name="changelog"
classname="org.apache.maven.changelog.ChangeLog">
<classpath refid="maven-classpath"/>
</taskdef>
<taskdef
name="dvsl"
classname="org.apache.tools.dvsl.DVSLTask">
<classpath refid="maven-classpath"/>
</taskdef>
<goal name="activity"
description="Generate developer and file activity reports"
prereqs="activity:generate"/>
<goal name="activity:generate"
description="Generate developer and file activity reports">
<mkdir dir="${maven.build.dir}/generated-xdocs"/>
<changelog
projectDescriptor="project.xml"
baseDir="."
output="${maven.build.dir}/activity-log.xml"
range="${maven.activitylog.range}"
factory="${maven.changelog.factory}"
outputEncoding="${maven.docs.outputencoding}"
/>
<!-- Transform the activity log into developer activity first -->
<dvsl
basedir="${maven.build.dir}"
destdir="${maven.gen.docs}/"
extension=".xml"
force="true"
toolboxfile="${plugin.dir}/toolbox.props"
style="${plugin.dir}/developer-activity.dvsl"
includes="activity-log.xml"
outputencoding="${maven.docs.outputencoding}">
<!-- Need to add the maven jar to load the toolbox -->
<classpath refid="maven-classpath"/>
<tool name="toolbox.string.range" value="${maven.activitylog.range}"/>
<tool name="toolbox.string.basedir" value="${basedir}"/>
</dvsl>
<!-- Transform the activity log into file activity-->
<dvsl
extension=".xml"
force="true"
toolboxfile="${plugin.dir}/toolbox.props"
style="${plugin.dir}/file-activity.dvsl"
in="${maven.build.dir}/activity-log.xml"
out="${maven.gen.docs}/file-activity-report.xml">
<!-- Need to add the maven jar to load the toolbox -->
<classpath refid="maven-classpath"/>
<tool name="toolbox.string.basedir" value="${basedir}"/>
<tool name="toolbox.string.range" value="${maven.activitylog.range}"/>
</dvsl>
</goal>
</project>
1.1
jakarta-turbine-maven/src/plugins-build/activity/plugin.properties
Index: plugin.properties
===================================================================
# -------------------------------------------------------------------
# P L U G I N P R O P E R I E S
# -------------------------------------------------------------------
# Activity log plugin.
# -------------------------------------------------------------------
maven.src.dir = ${basedir}/src
maven.build.dir = ${basedir}/target
maven.docs.dest = ${maven.build.dir}/docs
maven.docs.outputencoding = ISO-8859-1
maven.gen.docs = ${maven.build.dir}/generated-xdocs
maven.changelog.range = 5
maven.activitylog.range = 30
maven.changelog.factory = org.apache.maven.cvslib.CvsChangeLogFactory
1.1
jakarta-turbine-maven/src/plugins-build/activity/project.properties
Index: project.properties
===================================================================
# -------------------------------------------------------------------
# P R O J E C T P R O P E R T I E S
# -------------------------------------------------------------------
#maven.jarResources.basedir = src
1.1 jakarta-turbine-maven/src/plugins-build/activity/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<pomVersion>3</pomVersion>
<id>ant</id>
<name>Ant Plugin</name>
<currentVersion>1.0</currentVersion>
<organization>
<name>Apache Software Foundation</name>
<url>http://jakarta.apache.org/</url>
<logo>/images/jakarta-logo-blue.gif</logo>
</organization>
<inceptionYear>2001</inceptionYear>
<package>org.apache.maven</package>
<logo>/images/maven.jpg</logo>
<!-- Gump integration -->
<gumpRepositoryId>jakarta</gumpRepositoryId>
<description>
</description>
<shortDescription>Java Project Management Tools</shortDescription>
<url>http://jakarta.apache.org/turbine/maven/</url>
<issueTrackingUrl>http://nagoya.apache.org/scarab/servlet/scarab/</issueTrackingUrl>
<siteAddress>jakarta.apache.org</siteAddress>
<siteDirectory>/www/jakarta.apache.org/turbine/maven/</siteDirectory>
<distributionDirectory>/www/jakarta.apache.org/builds/jakarta-turbine-maven/</distributionDirectory>
<repository>
<connection>scm:cvs:pserver:[EMAIL PROTECTED]:/home/cvspublic:jakarta-turbine-maven</connection>
<url>http://cvs.apache.org/viewcvs/jakarta-turbine-maven/</url>
</repository>
<versions>
</versions>
<branches>
</branches>
<mailingLists/>
<developers/>
<dependencies/>
<build/>
</project>
1.1 jakarta-turbine-maven/src/plugins-build/activity/toolbox.props
Index: toolbox.props
===================================================================
toolbox.contextname = toolbox
toolbox.tool.htmlescape = org.apache.velocity.anakia.Escape
toolbox.tool.numbers = java.text.DecimalFormat
toolbox.tool.fileutil = org.apache.velocity.texen.util.FileUtil
toolbox.tool.strings = org.apache.commons.lang.Strings
toolbox.tool.formatter = org.apache.maven.DVSLFormatter
toolbox.tool.pathtool = org.apache.maven.DVSLPathTool
toolbox.tool.maven = org.apache.maven.MavenTool
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>