From: Carlos S. <car...@us...> - 2005-06-10 06:16:53
|
carlossg 05/06/09 23:16:45 Added: cobertura .cvsignore plugin.jelly plugin.properties project.xml cobertura/xdocs index.xml Log: Initial import Revision Changes Path 1.1 maven-plugins/cobertura/.cvsignore Index: .cvsignore =================================================================== target maven.log .project *.log 1.1 maven-plugins/cobertura/plugin.jelly Index: plugin.jelly =================================================================== <?xml version="1.0"?> <project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:log="jelly:log" xmlns:maven="jelly:maven" xmlns:define="jelly:define" xmlns:u="jelly:util" xmlns:doc="doc"> <!-- global definitions --> <ant:path id="cobertura.classpath"> <ant:pathelement path="${maven.build.dest}"/> <ant:pathelement path="${plugin.getDependencyPath('urbanophile:java-getopt')}"/> <ant:pathelement path="${plugin.getDependencyPath('javancss:javancss')}"/> <ant:pathelement path="${plugin.getDependencyPath('javancss:ccl')}"/> <ant:pathelement path="${plugin.getDependencyPath('asm')}"/> <ant:pathelement path="${plugin.getDependencyPath('oro')}"/> <ant:pathelement path="${plugin.getDependencyPath('log4j')}"/> <ant:pathelement path="${plugin.getDependencyPath('cobertura')}"/> </ant:path> <ant:taskdef classpath="${plugin.getDependencyPath('cobertura')}" resource="tasks.properties" /> <maven:get plugin="maven-xdoc-plugin" property="maven.docs.dest" var="docsDest"/> <j:set var="coberturaDocs" value="${docsDest}/cobertura"/> <goal name="maven-cobertura-plugin:register" description="Register the maven-cobertura-plugin."> <j:if test="${sourcesPresent == 'true'}"> <doc:registerReport name="Cobertura" pluginName="maven-cobertura-plugin" link="cobertura/index" target="_blank" description="Cobertura test coverage report." /> </j:if> </goal> <goal name="maven-cobertura-plugin:deregister" description="Deregister the maven-cobertura-plugin"> <j:if test="${sourcesPresent == 'true'}"> <doc:deregisterReport name="Cobertura" /> </j:if> </goal> <!-- ================================================================== --> <!-- D E F A U L T R E P O R T --> <!-- ================================================================== --> <goal name="maven-cobertura-plugin:report" description="Run the default report (html)."> <attainGoal name="cobertura:html-report" /> </goal> <!-- ================================================================== --> <!-- I N S T R U M E N T A T I O N --> <!-- ================================================================== --> <goal name="cobertura:on" description="perform the coverage analysis" prereqs="java:compile"> <j:catch var="ex"> <j:set var="instrumented" value="${maven.cobertura.instrumentation}"/> <j:set var="oldBuildDest" value="${maven.build.dest}"/> <j:set var="fork" value="${maven.cobertura.junit.fork}"/> <maven:get plugin="maven-test-plugin" property="maven.junit.fork" var="oldfork"/> <!-- reset the maven.build.dest for the test plugin to find the instrumented classes --> <maven:set plugin="maven-java-plugin" property="maven.build.dest" value="${instrumented}"/> <maven:set plugin="maven-test-plugin" property="maven.build.dest" value="${instrumented}"/> <!-- set the maven.junit.fork property --> <maven:set plugin="maven-test-plugin" property="maven.junit.fork" value="${fork}"/> <ant:mkdir dir="${coberturaDocs}" /> <ant:mkdir dir="${maven.cobertura.instrumentation}" /> <log:info>instrumenting the class-files...</log:info> <maven:addPath id="maven.dependency.classpath" refid="cobertura.classpath"/> <ant:cobertura-instrument todir="${maven.cobertura.instrumentation}"> <ant:fileset dir="${maven.build.dest}" includes="${maven.cobertura.instrumentation.includes}" excludes="${maven.cobertura.instrumentation.excludes}"/> <ant:classpath> <ant:path refid="cobertura.classpath"/> </ant:classpath> </ant:cobertura-instrument> <ant:copy todir="${maven.cobertura.instrumentation}"> <ant:fileset dir="${maven.build.dest}"> <ant:exclude name="**/*.class" /> <ant:exclude name="${maven.cobertura.instrumentation.excludes}" /> </ant:fileset> </ant:copy> </j:catch> <j:if test="${ex != null}"> <log:error>${ex}</log:error> <ant:fail message="${ex}" /> </j:if> </goal> <!-- ================================================================== --> <!-- D E F A U L T G O A L --> <!-- ================================================================== --> <goal name="cobertura" description="Generate HTML test coverage reports with Cobertura" prereqs="cobertura:html-report" /> <!-- ================================================================== --> <!-- R E P O R T G O A L --> <!-- ================================================================== --> <goal name="cobertura:html-report" description="Generate HTML test coverage reports with Cobertura" prereqs="cobertura:on,test:test"> <j:choose> <j:when test="${unitTestSourcesPresent == 'true'}"> <j:catch var="ex"> <j:set var="sourceDir" value="${context.getAntProject().getReferences().get('maven.compile.src.set')}" /> <u:tokenize var="sourceDirList" delim="${path.separator}">${sourceDir}</u:tokenize> <j:if test="${size(sourceDirList) != 1}"> <echo>Copying ${size(sourceDirList)} source directories into one for cobertura</echo> <j:set var="sourceDir" value="${maven.cobertura.dir}/sources" /> <ant:copy todir="${sourceDir}"> <j:forEach var="dir" items="${sourceDirList}"> <ant:fileset dir="${dir}" /> </j:forEach> </ant:copy> </j:if> <ant:cobertura-report srcdir="${sourceDir}" destdir="${coberturaDocs}"> <ant:classpath> <ant:path refid="cobertura.classpath"/> </ant:classpath> </ant:cobertura-report> <maven:set plugin="maven-java-plugin" property="maven.junit.fork" value="${oldfork}"/> <maven:set plugin="maven-java-plugin" property="maven.build.dest" value="${oldBuildDest}"/> <maven:set plugin="maven-test-plugin" property="maven.build.dest" value="${oldBuildDest}"/> </j:catch> <j:if test="${ex != null}"> <log:error>${ex}</log:error> <ant:fail message="${ex}" /> </j:if> </j:when> <j:otherwise> <ant:echo>No tests to run Cobertura on.</ant:echo> </j:otherwise> </j:choose> </goal> </project> 1.1 maven-plugins/cobertura/plugin.properties Index: plugin.properties =================================================================== maven.cobertura.dir=${maven.build.dir}/cobertura maven.cobertura.instrumentation=${maven.cobertura.dir}/classes maven.cobertura.junit.fork=yes maven.cobertura.instrumentation.includes=**/*.class maven.cobertura.instrumentation.excludes=NOT_DEFINED 1.1 maven-plugins/cobertura/project.xml Index: project.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <!-- /* * Copyright 2001-2005 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. */ --> <project> <extend>${basedir}/../plugin-project.xml</extend> <pomVersion>3</pomVersion> <artifactId>maven-cobertura-plugin</artifactId> <name>Cobertura Plug-in</name> <currentVersion>1.0-SNAPSHOT</currentVersion> <inceptionYear>2005</inceptionYear> <description>Maven Plugin for Cobertura</description> <shortDescription>Maven Plugin for Cobertura</shortDescription> <url>http://maven-plugins.sourceforge.net/maven-cobertura-plugin</url> <repository> <connection>scm:cvs:pserver:ano...@cv...:/cvsroot/maven-plugins:maven-plugins/cobertura</connection> <developerConnection>scm:cvs:ssh:use...@cv...:/cvsroot/maven-plugins:maven-plugins/cobertura</developerConnection> <url>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/maven-plugins/maven-plugins/cobertura/</url> </repository> <versions> </versions> <developers> <developer> <name>Carlos Sanchez</name> <id>carlossg</id> <email>ca...@ap...</email> <roles> <role>Software Developer</role> </roles> </developer> </developers> <dependencies> <dependency> <groupId>cobertura</groupId> <artifactId>cobertura</artifactId> <version>1.4</version> <url>http://cobertura.sourceforge.net</url> </dependency> <dependency> <groupId>oro</groupId> <artifactId>oro</artifactId> <version>2.0.8</version> <url>http://asm.objectweb.org</url> </dependency> <dependency> <groupId>asm</groupId> <artifactId>asm</artifactId> <version>2.0</version> <url>http://asm.objectweb.org</url> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.8</version> <url>http://logging.apache.org/log4j</url> </dependency> <dependency> <groupId>urbanophile</groupId> <artifactId>java-getopt</artifactId> <version>1.0.9</version> <url>http://www.urbanophile.com/arenn/hacking/download.html</url> </dependency> <dependency> <groupId>javancss</groupId> <artifactId>javancss</artifactId> <version>21.41</version> <url>http://www.kclee.de/clemens/java/javancss/</url> </dependency> <dependency> <groupId>javancss</groupId> <artifactId>ccl</artifactId> <version>21.41</version> <url>http://www.kclee.de/clemens/java/javancss/</url> </dependency> </dependencies> </project> 1.1 maven-plugins/cobertura/xdocs/index.xml Index: index.xml =================================================================== <?xml version="1.0" encoding="ISO-8859-1" ?> <!-- /* * 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. */ --> <document> <properties> <title>Cobertura Plugin</title> </properties> <body> <section name="Cobertura Plugin"> <p> The Cobertura tool is a free and easy to use source code coverage analyser. It helps you to discover where your source-code lacks in test coverage. </p> <p> For more information regarding Cobertura check out the <a href="http://cobertura.sourceforge.net/" target="_blank"> project homepage</a>. </p> </section> </body> </document> |