package org.pmdreports.ant;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.pmdreports.manager.PMDManager;
import org.pmdreports.manager.ReportManager;


/**
 * Run the TeamPMD tool from Ant.
 * 
 * @author Ben Northrop, Sep 25, 2007
 */
public class RunTeamPMDTask extends Task
{
    /**
     * Executed when Ant task is invoked.
     */
    public void execute() throws BuildException
    {
        PMDManager pmdManager = new PMDManager();
        pmdManager.runPMD();

        ReportManager reportManager = new ReportManager();
        reportManager.generateReports();
    }
}
