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

  <goal name="maven-tasklist-plugin:register">
    <j:if test="${sourcesPresent}">
      <doc:registerReport 
        name="Task List"
        pluginName="maven-tasklist-plugin" 
        link="task-list"
        description="Report on tasks specified in the source code."/>
    </j:if>
  </goal>
  
  <goal name="maven-tasklist-plugin:deregister">
    <j:if test="${sourcesPresent}">
      <doc:deregisterReport name="Task List"/>
    </j:if>
  </goal>

  <!-- ================================================================== -->
  <!-- T A S K   C R E A T I O N                                          -->
  <!-- ================================================================== -->
  
  <goal name="tasklist" prereqs="maven-tasklist-plugin:report"/>
  
  <goal 
    name="maven-tasklist-plugin:report"
    prereqs="xdoc:init"
    description="Generate a list of tasks from @todo tags in your code">

    <j:set var="genDocs"  value="${maven.gen.docs}"/>
    <j:set var="encoding" value="${maven.docs.outputencoding}"/>

    <j:set var="taskTag" value="${maven.tasklist.taskTag}"/>

    <j:if test="${sourcesPresent == 'true'}">
      
      <echo>Generating tasklist ...</echo>
      
      <vdoclet:vdoclet
        srcDir="${pom.build.sourceDirectory}"
        destDir="${genDocs}"
        template="plugin-resources/templates/tasklist.vm"
        outputFile="task-list.xml"
        encoding="${encoding}"
      />
     
    </j:if>

  </goal>

</project>
