You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by vm...@apache.org on 2004/07/02 22:57:16 UTC
cvs commit: maven-plugins/announcement plugin.jelly plugin.properties
vmassol 2004/07/02 13:57:16
Modified: announcement/xdocs changes.xml goals.xml properties.xml
announcement/src/plugin-resources announcement.jsl
announcement plugin.jelly plugin.properties
Log:
- Added new <code>announcement:generate-all</code> to generate announcement files for all releases.
- Generates the announcement file in <code>${maven.gen.docs}/announcements</code> so that it is copied to the web site when this later is deployed.
- Default announcement file name now contains the version in its name.
Revision Changes Path
1.18 +11 -0 maven-plugins/announcement/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/announcement/xdocs/changes.xml,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- changes.xml 24 Jun 2004 08:50:31 -0000 1.17
+++ changes.xml 2 Jul 2004 20:57:16 -0000 1.18
@@ -25,6 +25,17 @@
</properties>
<body>
<release version="1.2-SNAPSHOT" date="in CVS">
+ <action dev="vmassol" type="add">
+ Added new <code>announcement:generate-all</code> to generate
+ announcement files for all releases.
+ </action>
+ <action dev="vmassol" type="update">
+ Generates the announcement file in <code>${maven.gen.docs}/announcements</code>
+ so that it is copied to the web site when this later is deployed.
+ </action>
+ <action dev="vmassol" type="update">
+ Default announcement file name now contains the version in its name.
+ </action>
</release>
<release version="1.1" date="2004-05-15">
<action dev="brett" type="update">Detect whether the project is a plugin or not by the existence of plugin.jelly in the project directory, and change the wording accordingly.</action>
1.4 +9 -1 maven-plugins/announcement/xdocs/goals.xml
Index: goals.xml
===================================================================
RCS file: /home/cvs/maven-plugins/announcement/xdocs/goals.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- goals.xml 1 May 2004 17:53:24 -0000 1.3
+++ goals.xml 2 Jul 2004 20:57:16 -0000 1.4
@@ -1,4 +1,5 @@
<?xml version="1.0"?>
+
<!--
/*
* Copyright 2001-2004 The Apache Software Foundation.
@@ -37,7 +38,14 @@
<tr>
<td>announcement:generate</td>
<td>
- Generate text release announcement.
+ Generate a release announcement in text format
+ </td>
+ </tr>
+ <tr>
+ <td>announcement:generate-all</td>
+ <td>
+ Generate a release announcement in text format for all releases
+ found in <code>changes.xml</code>
</td>
</tr>
</table>
1.8 +1 -1 maven-plugins/announcement/xdocs/properties.xml
Index: properties.xml
===================================================================
RCS file: /home/cvs/maven-plugins/announcement/xdocs/properties.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- properties.xml 2 May 2004 08:20:59 -0000 1.7
+++ properties.xml 2 Jul 2004 20:57:16 -0000 1.8
@@ -45,7 +45,7 @@
The file name that the announcement is generated into.
</td>
<td>
- <code>${maven.build.dir}/announcement.txt</code>
+ <code>${maven.gen.docs}/announcements/announcement-${versionVariable}.txt</code>
</td>
</tr>
<tr>
1.13 +1 -1 maven-plugins/announcement/src/plugin-resources/announcement.jsl
Index: announcement.jsl
===================================================================
RCS file: /home/cvs/maven-plugins/announcement/src/plugin-resources/announcement.jsl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- announcement.jsl 11 May 2004 23:33:44 -0000 1.12
+++ announcement.jsl 2 Jul 2004 20:57:16 -0000 1.13
@@ -29,10 +29,10 @@
xmlns:maven="jelly:maven"
xmlns="dummy" trim="true">
+ <!-- This stylesheet expects the versionVariable to be defined before calling it -->
<jsl:template match="document/body/release">
<x:set var="version" select="string(@version)"/>
- <maven:property var="versionVariable" name="maven.announcement.version" defaultValue="${pom.currentVersion}"/>
<j:if test="${versionVariable.equals(version)}">
<j:useBean var="formatter" class="org.apache.maven.announcement.Formatter"/>
1.9 +67 -18 maven-plugins/announcement/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/announcement/plugin.jelly,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- plugin.jelly 2 May 2004 08:20:59 -0000 1.8
+++ plugin.jelly 2 Jul 2004 20:57:16 -0000 1.9
@@ -26,25 +26,35 @@
xmlns:util="jelly:util"
xmlns:doc="doc"
xmlns:maven="jelly:maven"
- xmlns:jsl="jelly:jsl">
+ xmlns:jsl="jelly:jsl"
+ xmlns:announcement="announcement">
<goal name="announcement" prereqs="announcement:generate"
description="Generate release announcement"/>
- <goal name="announcement:generate"
- description="Generate release announcement">
-
- <echo>Generating announcement for release ${maven.announcement.version} in ${maven.announcement.file}...</echo>
+ <goal name="announcement:init">
- <util:file var="inputFile" name="${maven.docs.src}/changes.xml"/>
- <x:parse var="doc" xml="${inputFile}"/>
-
<maven:property var="versionVariable" name="maven.announcement.version"
defaultValue="${pom.currentVersion}"/>
+ <maven:property var="announcementFile" name="maven.announcement.file"
+ defaultValue="${maven.gen.docs}/announcements/announcement-${versionVariable}.txt"/>
+
+ <!-- Ensure the directory where the announcement will be created exists -->
+ <ant:dirname property="announcementDir" file="${announcementFile}"/>
+ <ant:mkdir dir="${announcementDir}"/>
+
+ <util:file var="inputFile" name="${maven.docs.src}/changes.xml"/>
+
<maven:property var="distributionUrl" name="maven.announcement.distributionUrl"
defaultValue="${maven.repo.remote}/${pom.groupId}/plugins"/>
-
+
+ </goal>
+
+ <goal name="announcement:check-version" prereqs="announcement:init">
+
+ <x:parse var="doc" xml="${inputFile}"/>
+
<jsl:stylesheet select="$doc">
<jsl:template match="document/body/release">
<x:set var="version" select="string(@version)"/>
@@ -52,22 +62,61 @@
<x:set var="versionFound" select="string(@version)"/>
</j:if>
</jsl:template>
+ <jsl:template match="@*"/>
+ <jsl:template match="text()"/>
</jsl:stylesheet>
<j:if test="${versionFound == null}">
<ant:fail>The release '${maven.announcement.version}' could not be found in change log</ant:fail>
</j:if>
- <j:set var="stylesheetURI"
- value="file:${plugin.resources}/announcement.jsl"/>
- <j:file
- name="${maven.announcement.file}"
- outputMode="xml"
- omitXmlDeclaration="true"
- prettyPrint="false">
- <j:include uri="${stylesheetURI.toString()}"/>
- </j:file>
+ </goal>
+
+ <goal name="announcement:generate" prereqs="announcement:check-version"
+ description="Generate release announcement">
+
+ <announcement:generate file="${announcementFile}"/>
</goal>
+
+ <goal name="announcement:generate-all" prereqs="announcement:init"
+ description="Generate release announcement for all releases">
+
+ <x:parse var="doc" xml="${inputFile}"/>
+
+ <jsl:stylesheet select="$doc">
+ <jsl:template match="document/body/release">
+ <x:set var="versionVariable" select="string(@version)"/>
+ <j:set var="announcementFile"
+ value="${maven.gen.docs}/announcements/announcement-${versionVariable}.txt"/>
+ <announcement:generate file="${announcementFile}"/>
+ </jsl:template>
+ <jsl:template match="@*"/>
+ <jsl:template match="text()"/>
+ </jsl:stylesheet>
+
+ </goal>
+
+ <!-- Define common jelly script used by different goals as a jelly tag -->
+ <define:taglib uri="announcement">
+ <define:tag name="generate">
+ <!-- @file: Announcement file location -->
+ <!-- @versionVariable: version for which to generate the announcement -->
+
+ <echo>Generating announcement for release ${versionVariable} in ${file}...</echo>
+
+ <j:set var="stylesheetURI"
+ value="file:${plugin.resources}/announcement.jsl"/>
+
+ <j:file
+ name="${file}"
+ outputMode="xml"
+ omitXmlDeclaration="true"
+ prettyPrint="false">
+ <j:include uri="${stylesheetURI.toString()}"/>
+ </j:file>
+
+ </define:tag>
+ </define:taglib>
</project>
1.10 +0 -3 maven-plugins/announcement/plugin.properties
Index: plugin.properties
===================================================================
RCS file: /home/cvs/maven-plugins/announcement/plugin.properties,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- plugin.properties 11 May 2004 23:33:44 -0000 1.9
+++ plugin.properties 2 Jul 2004 20:57:16 -0000 1.10
@@ -23,9 +23,6 @@
# For example:
# maven.announcement.version = ${pom.currentVersion}
-# Name and location of generated announcement file
-maven.announcement.file=${maven.build.dir}/announcement.txt
-
# Distribution location. For now, this property does not exist in the
# POM (there's only a distributionSite and distributionDirectory which
# doesn't map to anything for the web). We'll need to remove this
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org