<?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:doc="doc">

  <goal name="maven-changes-plugin:register">
    <util:file var="changes" name="${maven.docs.src}/changes.xml"/>
    <j:if test="${changes.exists()}">
      <doc:registerReport 
        name="Changes" 
        pluginName="changes"
        link="changes-report"
        description="Report on the project changes."/>
     </j:if>
  </goal>
  
  <goal name="maven-changes-plugin:deregister">
    <doc:deregisterReport name="Changes"/>
  </goal>

  <!-- ================================================================== -->
  <!-- C H A N G E S  R E P O R T                                         -->
  <!-- ================================================================== -->

  <goal
    name="changes:report"
    description="Generate a changes report">

    <doc:jsl
      input="${maven.docs.src}/changes.xml"
      output="changes-report.xml"
      stylesheet="${plugin.resources}/changes.jsl"
      encoding="${maven.docs.outputencoding}"
      outputMode="xml"
      prettyPrint="true"
      />
    
  </goal>

  <define:taglib uri="changes:transform">
    <define:tag name="release-version">
      <j:useBean var="transformer" class="org.apache.maven.changes.ReleaseVersion"/>
      <util:file var="f" name="${maven.docs.src}/changes.xml" />
      <j:choose>
        <j:when test="${date != null}">
          ${transformer.releaseVersion(f, pom.currentVersion, version, date)}
        </j:when>
        <j:otherwise>
          ${transformer.releaseVersion(f, pom.currentVersion, version)}
        </j:otherwise>
      </j:choose>
    </define:tag>
  </define:taglib>
</project>
