git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@410983 13f79535-47bb-0310-9956-ffa450edef68
205 lines
7.4 KiB
XML
205 lines
7.4 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:multiproject="multiproject"
|
|
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">
|
|
|
|
<!--
|
|
========================================================================
|
|
Initialize Multichanges plugin data.
|
|
========================================================================
|
|
-->
|
|
<goal name="multichanges:init">
|
|
|
|
<!-- Default reactor properties from the Multiproject plug-in -->
|
|
|
|
<!-- Make sure the multiproject plugin is loaded -->
|
|
<m:set plugin="maven-multiproject-plugin" property="foo" value="bar"/>
|
|
|
|
<m:get var="mBasedir" property="maven.multiproject.basedir" plugin="maven-multiproject-plugin"/>
|
|
<m:property var="dBasedir" name="maven.multichanges.basedir" defaultValue="${mBasedir}"/>
|
|
|
|
<m:get var="mIncludes" property="maven.multiproject.includes" plugin="maven-multiproject-plugin"/>
|
|
<m:property var="dIncludes" name="maven.multichanges.includes" defaultValue="${mIncludes}"/>
|
|
|
|
<m:get var="mExcludes" property="maven.multiproject.excludes" plugin="maven-multiproject-plugin"/>
|
|
<m:property var="dExcludes" name="maven.multichanges.excludes" defaultValue="${mExcludes}"/>
|
|
|
|
<m:get var="mIgnoreFailures" property="maven.multiproject.ignoreFailures" plugin="maven-multiproject-plugin"/>
|
|
<m:property var="dIgnoreFailures" name="maven.multichanges.ignoreFailures" defaultValue="${mIgnoreFailures}"/>
|
|
|
|
</goal>
|
|
|
|
|
|
<!--
|
|
========================================================================
|
|
Generate a multiproject release report, providing a unified view of
|
|
the latest release of projects.
|
|
========================================================================
|
|
-->
|
|
<goal name="multichanges:report" prereqs="multichanges:generates-releases-report,multichanges:generates-releases-rss"/>
|
|
|
|
<goal name="multichanges:generates-releases-file" prereqs="multichanges:init">
|
|
|
|
<!-- Gather project list using the maven reactor -->
|
|
<m:reactor
|
|
basedir="${dBasedir}"
|
|
banner="Gathering project list"
|
|
includes="${dIncludes}"
|
|
excludes="${dExcludes}"
|
|
postProcessing="true"
|
|
collectOnly="true"
|
|
ignoreFailures="${dIgnoreFailures}"/>
|
|
|
|
<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>
|
|
<x:attribute name="artifactId">
|
|
${reactorProject.artifactId}
|
|
</x:attribute>
|
|
<x:attribute name="url">
|
|
${reactorProject.url}
|
|
</x:attribute>
|
|
<x:attribute name="nextVersion">
|
|
${reactorProject.currentVersion}
|
|
</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>
|
|
|
|
</goal>
|
|
|
|
<goal name="multichanges:generates-releases-report" prereqs="multichanges:generates-releases-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>
|
|
|
|
<goal name="multichanges:generates-releases-rss" prereqs="multichanges:generates-releases-file">
|
|
|
|
<tstamp>
|
|
<format property="currentDate" pattern="EEE, dd MMM yyyy HH:mm:ss Z"/>
|
|
</tstamp>
|
|
<tstamp>
|
|
<format property="currentYear" pattern="yyyy"/>
|
|
</tstamp>
|
|
|
|
<!-- Generate a RSS feed of the changes -->
|
|
<doc:jsl
|
|
input="${maven.multichanges.data}"
|
|
output="releases.rss"
|
|
stylesheet="${plugin.resources}/releases2rss.jsl"
|
|
encoding="${maven.docs.outputencoding}"
|
|
outputMode="xml"
|
|
prettyPrint="false"/>
|
|
|
|
<!-- Copy the images -->
|
|
<mkdir dir="${maven.docs.dest}/images"/>
|
|
<copy todir="${maven.docs.dest}/images">
|
|
<fileset dir="${plugin.resources}/images"/>
|
|
</copy>
|
|
|
|
</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>
|