2004-05-01 12:40:47 +00:00

137 lines
4.8 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.
*/
-->
<project
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:define="jelly:define"
xmlns:util="jelly:util"
xmlns:m="jelly:maven"
xmlns:x="jelly:xml"
xmlns:doc="doc">
<!--
========================================================================
Generate a multiproject release report, providing a unified view of
the latest release of projects.
========================================================================
-->
<goal name="multichanges:report">
<!-- Gather project list using the maven reactor -->
<m:reactor
basedir="${maven.multichanges.basedir}"
banner="Gathering project list"
includes="${maven.multichanges.includes}"
excludes="${maven.multichanges.excludes}"
postProcessing="true"
collectOnly="true"
ignoreFailures="${maven.multichanges.ignoreFailures}"/>
<ant:dirname property="dataReportDir" file="${maven.multichanges.data}"/>
<ant:mkdir dir="${dataReportDir}"/>
<j:file name="${maven.multichanges.data}" prettyPrint="true"
xmlns="release">
<releases>
<j:forEach var="reactorProject" items="${reactorProjects}">
<x:element name="project">
<x:attribute name="name">
${reactorProject.name}
</x:attribute>
<util:file var="changesAsFile"
name="${reactorProject.context.getVariable('maven.docs.src')}/changes.xml"/>
<j:choose>
<j:when test="${changesAsFile.exists()}">
<x:parse var="doc" xml="${changesAsFile}"/>
<!-- Extract latest version. We assume it is contained in
the first <release> tag found -->
<!-- TODO: Improve algorithm by writing a java bean -->
<x:set var="versionElems"
select="$doc//release[contains(@date,'-')]"/>
<j:choose>
<j:when test="${not(versionElems.isEmpty())}">
<x:attribute name="version">
${versionElems.get(0).attributeValue('version')}
</x:attribute>
<x:attribute name="date">
${versionElems.get(0).attributeValue('date')}
</x:attribute>
</j:when>
<j:otherwise>
<x:attribute name="version">
Not released
</x:attribute>
<x:attribute name="date">
Not released
</x:attribute>
</j:otherwise>
</j:choose>
</j:when>
<j:otherwise>
<x:attribute name="version">
No information available
</x:attribute>
<x:attribute name="date">
No information available
</x:attribute>
</j:otherwise>
</j:choose>
</x:element>
</j:forEach>
</releases>
</j:file>
<ant:dirname property="reportDir" file="${maven.multichanges.report}"/>
<ant:mkdir dir="${reportDir}"/>
<doc:jsl
input="${maven.multichanges.data}"
output="${maven.multichanges.report}.xml"
stylesheet="${plugin.resources}/releases.jsl"
outputMode="xml"
prettyPrint="true"/>
</goal>
<!--
========================================================================
Register the report to the xdoc plugin.
========================================================================
-->
<goal name="maven-multichanges-plugin:register">
<doc:registerReport
name="Releases"
pluginName="multichanges"
link="${maven.multichanges.report}"
description="Report on latest project releases."/>
</goal>
<!--
========================================================================
Unregister the report to the xdoc plugin.
========================================================================
-->
<goal name="maven-multichanges-plugin:deregister">
<doc:deregisterReport name="Releases"/>
</goal>
</project>