From: Carlos S. <car...@us...> - 2005-06-15 16:50:00
|
carlossg 05/06/15 09:49:43 Modified: cobertura plugin.jelly plugin.properties cobertura/xdocs properties.xml Log: Added maven.cobertura.datafile property Revision Changes Path 1.2 +18 -6 maven-plugins/cobertura/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/cobertura/plugin.jelly,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- plugin.jelly 10 Jun 2005 06:16:44 -0000 1.1 +++ plugin.jelly 15 Jun 2005 16:49:41 -0000 1.2 @@ -73,6 +73,10 @@ <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"/> + <maven:get plugin="maven-test-plugin" property="maven.test.failure.ignore" var="ignoreTestFailureOld"/> + + <!-- Make sure that the report is generated whether the tests pass or not --> + <maven:set plugin="maven-test-plugin" property="maven.test.failure.ignore" value="true"/> <!-- 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}"/> @@ -90,7 +94,7 @@ <maven:addPath id="maven.dependency.classpath" refid="cobertura.classpath"/> - <ant:cobertura-instrument todir="${maven.cobertura.instrumentation}"> + <ant:cobertura-instrument todir="${maven.cobertura.instrumentation}" datafile="${maven.cobertura.datafile}"> <ant:fileset dir="${maven.build.dest}" includes="${maven.cobertura.instrumentation.includes}" excludes="${maven.cobertura.instrumentation.excludes}"/> @@ -127,7 +131,9 @@ <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"> @@ -144,25 +150,31 @@ </ant:copy> </j:if> - <ant:cobertura-report srcdir="${sourceDir}" destdir="${coberturaDocs}"> - <ant:classpath> - <ant:path refid="cobertura.classpath"/> - </ant:classpath> - </ant:cobertura-report> + <ant:cobertura-report srcdir="${sourceDir}" destdir="${coberturaDocs}" datafile="${maven.cobertura.datafile}"> + <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:expr value="${pom.getPluginContext('maven-test-plugin').setVariable( + 'maven.test.failure.ignore', ignoreTestFailureOld)}"/> </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> 1.2 +1 -0 maven-plugins/cobertura/plugin.properties Index: plugin.properties =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/cobertura/plugin.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- plugin.properties 10 Jun 2005 06:16:44 -0000 1.1 +++ plugin.properties 15 Jun 2005 16:49:42 -0000 1.2 @@ -3,3 +3,4 @@ maven.cobertura.junit.fork=yes maven.cobertura.instrumentation.includes=**/*.class maven.cobertura.instrumentation.excludes=NOT_DEFINED +maven.cobertura.datafile=${maven.cobertura.dir}/cobertura.ser 1.2 +8 -0 maven-plugins/cobertura/xdocs/properties.xml Index: properties.xml =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/cobertura/xdocs/properties.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- properties.xml 10 Jun 2005 06:24:56 -0000 1.1 +++ properties.xml 15 Jun 2005 16:49:43 -0000 1.2 @@ -71,6 +71,14 @@ Specifies the fork attribute for the JUnit test for the coverage analysis. </td> </tr> + <tr> + <td>maven.cobertura.datafile</td> + <td>${maven.cobertura.dir}/cobertura.ser</td> + <td>Yes</td> + <td> + Specify the name of the file to use for storing the metadata about your classes. + </td> + </tr> </table> </section> </body> |