Use commons-lang StringUtils for string replacement to fix maven 1.0 compatibility issues.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@372636 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0b100a389b
commit
b3fa3b0428
@ -125,6 +125,7 @@
|
||||
<j:forEach var="reactorProject" items="${reactorProjects}">
|
||||
<u:available
|
||||
file="${reactorProject.context.getVariable('maven.build.dir')}/dashboard-single.xml">
|
||||
<!-- FIXME: this should be maven.dashboard.report.single -->
|
||||
|
||||
<x:element name="project">
|
||||
<x:attribute name="name">${reactorProject.name}</x:attribute>
|
||||
@ -187,6 +188,8 @@
|
||||
-->
|
||||
<goal name="dashboard:report-single">
|
||||
|
||||
<j:useBean var="stringUtils" class="org.apache.commons.lang.StringUtils"/>
|
||||
|
||||
<a:dirname property="singleReportDir" file="${maven.dashboard.report.single}"/>
|
||||
<a:mkdir dir="${singleReportDir}"/>
|
||||
|
||||
@ -240,6 +243,7 @@
|
||||
this is report used by the Clover aggregators to extract information
|
||||
from). The reason we disable the other reports is to win some response
|
||||
time. -->
|
||||
<!-- FIXME: pom.getVariable? -->
|
||||
<j:set var="cloverReportXml"
|
||||
value="${pom.getVariable('maven.clover.report.xml')}"/>
|
||||
<j:set var="maven.clover.report.xml" value="true" scope="parent"/>
|
||||
|
||||
@ -129,5 +129,15 @@
|
||||
<organization>IT20one GmbH</organization>
|
||||
</contributor>
|
||||
</contributors>
|
||||
<dependencies/>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.0</version>
|
||||
<url>http://jakarta.apache.org/commons/lang/</url>
|
||||
<properties>
|
||||
<comment>This library is already loaded by maven's core. Be careful to use the same version number as in the core.</comment>
|
||||
</properties>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@ -30,13 +30,10 @@
|
||||
|
||||
<j:choose>
|
||||
<j:when test="${artifactAsFile.exists()}">
|
||||
<u:loadText encoding="UTF-8" file="${maven.dashboard.aggregator.coberturalipc.artifact}" var="artifactAsText" />
|
||||
<u:replace new="" old="<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-02.dtd">"
|
||||
var="fileWithoutDTD" value="${artifactAsText}"/>
|
||||
|
||||
<u:loadText file="${maven.dashboard.aggregator.coberturalipc.artifact}" var="artifactAsText" />
|
||||
<j:set var="fileWithoutDTD" value="${stringUtils.replace(artifactAsText, '<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-02.dtd">', '')}"/>
|
||||
<x:parse var="doc" text="${fileWithoutDTD}"/>
|
||||
<x:expr select="floor(100*count($doc/coverage/packages/package/classes/class/lines/line[@hits>0]) div count($doc/coverage/packages/package/classes/class/lines/line[@number>0])+0.5)"/>
|
||||
%
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<j:expr value="-"/>
|
||||
|
||||
@ -30,9 +30,8 @@
|
||||
|
||||
<j:choose>
|
||||
<j:when test="${artifactAsFile.exists()}">
|
||||
<u:loadText encoding="UTF-8" file="${maven.dashboard.aggregator.coberturaloc.artifact}" var="artifactAsText" />
|
||||
<u:replace new="" old="<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-02.dtd">"
|
||||
var="fileWithoutDTD" value="${artifactAsText}"/>
|
||||
<u:loadText file="${maven.dashboard.aggregator.coberturaloc.artifact}" var="artifactAsText" />
|
||||
<j:set var="fileWithoutDTD" value="${stringUtils.replace(artifactAsText, '<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-02.dtd">', '')}"/>
|
||||
<x:parse var="doc" text="${fileWithoutDTD}"/>
|
||||
<x:expr select="count($doc/coverage/packages/package/classes/class/lines/line[@number>0])"/>
|
||||
</j:when>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user