org.naftulin.classpathexplorer
Class DublicateResourceDetectorAntTask

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.naftulin.classpathexplorer.DublicateResourceDetectorAntTask

public class DublicateResourceDetectorAntTask
extends org.apache.tools.ant.Task

Ant task that detects and reports dublicate resources. This task has the following properties: Path - either an inline path or path like structure that tell the task which direcotries or jar (zip) files to scan for dublicate resrources. Required attribute. AccetedExtensions - tells which files to consider when reporting dublicates. By default, all files are considered, but you might want to limit it to .class and .xml. Accepts a comma separated list of extensions. Not required. NumDublicateThreshold - how many dublicates should the task ignore, before reporing problem. Default is 0. FailOnError - if there are more dublicate files than threshold alows, should the build fail. Default is true.

Version:
1.0
Author:
henry naftulin

Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
DublicateResourceDetectorAntTask()
           
 
Method Summary
 org.apache.tools.ant.types.Path createPath()
          Path - either an inline path or path like structure that tell the task which direcotries or jar (zip) files to scan for dublicate resrources.
 void execute()
          Ant task that detects and reports dublicate resources.
 void setAcceptedExtensions(java.lang.String extensions)
          AccetedExtensions - tells which files to consider when reporting dublicates.
 void setFailOnError(boolean failOnError)
          FailOnError - if there are more dublicate files than threshold alows, should the build fail.
 void setNumDublicateThreshold(int numDublicateThreshold)
          NumDublicateThreshold - how many dublicates should the task ignore, before reporing problem.
 void setPath(org.apache.tools.ant.types.Path p)
          Path - either an inline path or path like structure that tell the task which direcotries or jar (zip) files to scan for dublicate resrources.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DublicateResourceDetectorAntTask

public DublicateResourceDetectorAntTask()
Method Detail

setPath

public void setPath(org.apache.tools.ant.types.Path p)
Path - either an inline path or path like structure that tell the task which direcotries or jar (zip) files to scan for dublicate resrources. Required attribute.

Parameters:
p - path

setAcceptedExtensions

public void setAcceptedExtensions(java.lang.String extensions)
AccetedExtensions - tells which files to consider when reporting dublicates. By default, all files are considered, but you might want to limit it to .class and .xml. Accepts a comma separated list of extensions. Not required.

Parameters:
extensions -

createPath

public org.apache.tools.ant.types.Path createPath()
Path - either an inline path or path like structure that tell the task which direcotries or jar (zip) files to scan for dublicate resrources. Required attribute.

Returns:
path.

setFailOnError

public void setFailOnError(boolean failOnError)
FailOnError - if there are more dublicate files than threshold alows, should the build fail. Default is true.

Parameters:
failOnError -

setNumDublicateThreshold

public void setNumDublicateThreshold(int numDublicateThreshold)
NumDublicateThreshold - how many dublicates should the task ignore, before reporing problem. Default is 0.

Parameters:
numDublicateThreshold -

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Ant task that detects and reports dublicate resources.

Overrides:
execute in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException


Copyright © 2006 Henry Naftulin. All Rights Reserved.