maven-plugins/statcvs/plugin.jelly
evenisse 85df922d35 Update to ASL v.2
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114795 13f79535-47bb-0310-9956-ffa450edef68
2004-03-04 18:40:25 +00:00

121 lines
4.3 KiB
XML

<?xml version="1.0"?>
<!--
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<!-- ==================================================================
Generate CVS statistics on the current CVS project
Note: Needs JDK 1.4+
================================================================== -->
<project
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
xmlns:ant="jelly:ant"
xmlns:doc="doc">
<goal name="statcvs:init">
<ant:available property="jdk14" classname="java.lang.CharSequence"/>
<j:if test="${jdk14 != 'true'}">
<ant:fail>The StatCvs plugin requires JDK 1.4+</ant:fail>
</j:if>
</goal>
<goal name="statcvs" prereqs="statcvs:generate"
description="Generate CVS statistics for the current CVS project"/>
<goal name="statcvs:generate" prereqs="statcvs:init"
description="Generate CVS statistics for the current CVS project">
<j:choose>
<j:when test="${maven.mode.online}">
<ant:echo>fetching cvs logs...</ant:echo>
<ant:mkdir dir="${maven.build.dir}"/>
<ant:property name="statcvs.logfile"
value="${maven.build.dir}/statcvs.log"/>
<!-- FIXME : Should we use the connection string defined
in project.xml? -->
<ant:cvs compression="true" command="-q log"
output="${statcvs.logfile}"/>
<property name="maven.docs.dest"
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}"/>
<property name="maven.gen.docs"
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}"/>
<ant:mkdir dir="${maven.docs.dest}/statcvs"/>
<ant:mkdir dir="${maven.gen.docs}/statcvs"/>
<j:set var="url" value="${pom.repository.url}"/>
<ant:java classname="net.sf.statcvs.Main" fork="true">
<ant:arg line="-output-dir ${maven.gen.docs}/statcvs"/>
<ant:arg line="-title '${pom.name}'"/>
<ant:arg line="-output-suite xdoc"/>
<ant:arg line="-verbose"/>
<j:if test="${!empty(url)}">
<ant:arg line="-weburl ${pom.repository.url}"/>
</j:if>
<!-- TODO/FIXME: For some reason, it is hanging if I use the
-use-history command line argument -->
<!--ant:arg line="-use-history"/-->
<ant:arg line="${statcvs.include}"/>
<ant:arg value="${statcvs.logfile}"/>
<ant:arg value="${basedir}/"/>
<ant:classpath>
<ant:pathelement location="${plugin.getDependencyPath('statcvs:statcvs-xml')}"/>
<ant:pathelement location="${plugin.getDependencyPath('jfreechart:jfreechart')}"/>
<ant:pathelement location="${plugin.getDependencyPath('jcommon:jcommon')}"/>
<ant:pathelement location="${plugin.getDependencyPath('jdom:jdom')}"/>
</ant:classpath>
</ant:java>
<!-- Copy images -->
<copy todir="${maven.docs.dest}/statcvs" overwrite="yes"
filtering="no">
<fileset dir="${maven.gen.docs}/statcvs">
<include name="**/*.png"/>
</fileset>
</copy>
</j:when>
<j:otherwise>
<ant:echo>StatCvs can obtain statistics in the online-mode only.</ant:echo>
</j:otherwise>
</j:choose>
</goal>
<goal name="maven-statcvs-plugin:register" prereqs="statcvs:init">
<doc:registerReport
name="StatCvs Report"
pluginName="statcvs"
link="statcvs/index"
description="Show some statistics about the CVS repository"/>
</goal>
<goal name="maven-statcvs-plugin:deregister" prereqs="statcvs:init">
<doc:deregisterReport name="StatCvs Report"/>
</goal>
<goal name="statcvs:report" prereqs="statcvs"/>
</project>