vmassol     2003/11/10 12:00:25

  Added:       multichanges/xdocs properties.xml .cvsignore changes.xml
                        index.xml navigation.xml goals.xml
               multichanges project.properties plugin.properties
                        project.xml plugin.jelly .cvsignore
               multichanges/src/plugin-resources releases.jsl
  Log:
  Initial release of multichanges plugin. It generates a release dashboard for all 
subprojects. An example can be found at 
http://maven.apache.org/reference/plugins/optional/release-report.html
  
  Revision  Changes    Path
  1.1                  maven-plugins/multichanges/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <document>
  
    <properties>
      <title>Multichanges properties</title>
      <author email="[EMAIL PROTECTED]">Vincent Massol</author>
    </properties>
  
    <body>
      <section name="Multichanges properties">
  <source><![CDATA[
  maven.multichanges.basedir=${basedir}
  maven.multichanges.includes=*/project.xml
  maven.multichanges.excludes=**/target/**/project.xml,project.xml
  maven.multichanges.ignoreFailures=false
  
  # Generated dashboard raw data file
  maven.multichanges.data = ${maven.build.dir}/multichanges.xml
  
  # Report name (without extension)
  maven.multichanges.report = multichanges-report
  ]]></source>
      </section>
    </body>
  </document>
  
  
  
  1.1                  maven-plugins/multichanges/xdocs/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  stylesheets
  
  
  
  1.1                  maven-plugins/multichanges/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
    <properties>
      <title>Changes</title>
      <author email="[EMAIL PROTECTED]">Vincent Massol</author>
    </properties>
  
    <body>
  
      <release version="1.0" date="in CVS">
        <action dev="vmassol" type="add">
          Initial creation.
        </action>              
      </release>
  
    </body>
  </document>
  
  
  
  
  1.1                  maven-plugins/multichanges/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <title>Maven Multichanges plugin</title>
      <author email="[EMAIL PROTECTED]">Vincent Massol</author>
    </properties>
  
    <body>
      <section name="Maven Multichanges plugin">
        <p>
          Generate a release dashboard from information found in 
          project <code>changes.xml</code> files. This plugin operates
          on all subprojects. It shows the latest release dates and
          versions of all subprojects.
        </p>
      </section>
   </body>
  
  </document>
  
  
  
  1.1                  maven-plugins/multichanges/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <project name="Maven Multichanges plugin">
  
    <title>Maven MultiChanges plugin</title>
  
    <body>
      <links>
        <item name="Maven"      href="http://maven.apache.org/"/>
      </links>
      <menu name="Overview">
        <item name="Goals"      href="/goals.html" />
        <item name="Properties" href="/properties.html" />
      </menu>
    </body>
  </project>
  
  
  
  1.1                  maven-plugins/multichanges/xdocs/goals.xml
  
  Index: goals.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <title>Maven Multichanges plugin Goals</title>
      <author email="[EMAIL PROTECTED]">Vincent Massol</author>
    </properties>
  
    <body>
      <section name="Goals">
        <p>
          This plugin is called automatically by the
          <code>site</code> plugin when it generates the project
          web site.
        </p>
        <table>
          <tr><th>Goal</th><th>Description</th></tr>
          <tr>
            <td>multichanges:report</td>
            <td>
              Generate the release dashboard showing the latest release dates
              and versions of the different subprojects.
            </td>
          </tr>
        </table>
      </section>
   </body>
  </document>
  
  
  
  1.1                  maven-plugins/multichanges/project.properties
  
  Index: project.properties
  ===================================================================
  # -------------------------------------------------------------------
  # P R O J E C T  P R O P E R T I E S
  # -------------------------------------------------------------------
  maven.xdoc.date=left
  maven.xdoc.version=${pom.currentVersion}
  maven.license.licenseFile=${basedir}/../LICENSE.txt
  
  
  
  1.1                  maven-plugins/multichanges/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  # -------------------------------------------------------------------
  # P L U G I N  P R O P E R I E S
  # -------------------------------------------------------------------
  # Multichanges plugin.
  # -------------------------------------------------------------------
  
  maven.multichanges.basedir=${basedir}
  maven.multichanges.includes=*/project.xml
  maven.multichanges.excludes=**/target/**/project.xml,project.xml
  maven.multichanges.ignoreFailures=false
  
  # Generated dashboard raw data file
  maven.multichanges.data = ${maven.build.dir}/multichanges.xml
  
  # Report name (without extension)
  maven.multichanges.report = multichanges-report
  
  
  
  1.1                  maven-plugins/multichanges/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
    <extend>../project.xml</extend>
    <pomVersion>3</pomVersion>
    <id>maven-multichanges-plugin</id>
    <name>Maven MultiChanges plugin</name>
    <currentVersion>1.0-SNAPSHOT</currentVersion>
    <shortDescription>Produce release dashboard for subprojects</shortDescription>
    <url>http://maven.apache.org/reference/plugins/multichanges/</url>
    
<siteDirectory>/www/maven.apache.org/reference/plugins/multichanges/</siteDirectory>
    <repository>
      <connection>scm:cvs:pserver:[EMAIL 
PROTECTED]:/home/cvspublic:maven-plugins/multichanges/</connection>
      <url>http://cvs.apache.org/viewcvs/maven-plugins/multichanges/</url>
    </repository>
    <versions>
      <version>
        <id>1.0</id>
        <name>1.0</name>
        <tag>HEAD</tag>
      </version>
    </versions>
    <developers>
      <developer>
        <name>Vincent Massol</name>
        <id>vmassol</id>
        <email>[EMAIL PROTECTED]</email>
        <organization>Pivolis</organization>
        <roles>
          <role>Creator</role>
          <role>Java Developer</role>
        </roles>
      </developer>
    </developers>
    <dependencies/>
    <reports>
      <report>maven-changes-plugin</report>
      <report>maven-changelog-plugin</report>
      <report>maven-file-activity-plugin</report>
      <report>maven-developer-activity-plugin</report>
      <report>maven-file-activity-plugin</report>
      <report>maven-license-plugin</report>
      <report>maven-linkcheck-plugin</report>
    </reports>
  </project>
  
  
  
  1.1                  maven-plugins/multichanges/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  <?xml version="1.0"?>
  
  <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">
  
      <m:reactor
          basedir="${maven.multichanges.basedir}"
          banner="Gathering project list"
          includes="${maven.multichanges.includes}"
          excludes="${maven.multichanges.excludes}"
          postProcessing="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>
  
    <goal name="maven-multichanges-plugin:register">
      <doc:registerReport 
          name="Releases" 
          pluginName="multichanges"
          link="${maven.multichanges.report}"
          description="Report on latest project releases."/>
    </goal>
    
    <goal name="maven-multichanges-plugin:deregister">
      <doc:deregisterReport name="Releases"/>
    </goal>
  
  </project>
  
  
  
  1.1                  maven-plugins/multichanges/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  target
  velocity.log
  maven.log
  build.properties
  .classpath
  .project
  
  
  
  1.1                  maven-plugins/multichanges/src/plugin-resources/releases.jsl
  
  Index: releases.jsl
  ===================================================================
  <?xml version="1.0"?>
      
  <jsl:stylesheet
      select="$doc"
      xmlns:j="jelly:core"
      xmlns:jsl="jelly:jsl"
      xmlns:x="jelly:xml"
      xmlns="dummy" trim="false">
  
    <jsl:template match="releases">  
      <document>
        <properties>
          <title>Latest releases</title>
        </properties>
        <body>
          <section name="Latest releases">
            <table>
              <tr>      
                <th>Project name</th>
                <th>Latest version</th>
                <th>Released date</th>
              </tr>
              <x:set var="projects" sort="@date" descending="true"
                  select="project[not(@date = 'Not released') and not(@date = 'No 
information available')]"/>
              <j:forEach var="project" items="${projects}">
                <tr>
                  <td>
                    <x:expr select="$project/@name"/>
                  </td>
                  <td>
                    <x:expr select="$project/@version"/>
                  </td>
                  <td>
                    <x:expr select="$project/@date"/>
                  </td>
                </tr>
              </j:forEach>
              <x:set var="projects" sort="@date" descending="true"
                  select="[EMAIL PROTECTED] = 'Not released']"/>
              <j:forEach var="project" items="${projects}">
                <tr>
                  <td>
                    <x:expr select="$project/@name"/>
                  </td>
                  <td>
                    <x:expr select="$project/@version"/>
                  </td>
                  <td>
                    <x:expr select="$project/@date"/>
                  </td>
                </tr>
              </j:forEach>
              <x:set var="projects" sort="@date" descending="true"
                  select="[EMAIL PROTECTED] = 'No information available']"/>
              <j:forEach var="project" items="${projects}">
                <tr>
                  <td>
                    <x:expr select="$project/@name"/>
                  </td>
                  <td>
                    <x:expr select="$project/@version"/>
                  </td>
                  <td>
                    <x:expr select="$project/@date"/>
                  </td>
                </tr>
              </j:forEach>
            </table>
          </section>
        </body>
      </document>
    </jsl:template>
  
  </jsl:stylesheet>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to