net.sourceforge.groboutils.codecoverage.v2.ant
Class GroboInstrumentTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bynet.sourceforge.groboutils.codecoverage.v2.ant.GroboInstrumentTask

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

A variation of the CoveragePostCompilerTask. This one is intended to simplify the Ant build files. See feature request 901588 for details.

Since:
March 9, 2004
Version:
$Date: 2004/04/17 08:24:39 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Nested Class Summary
static class GroboInstrumentTask.HandleExistingAttribute
          Contains all possible HandleExisting types.
static class GroboInstrumentTask.LoggerAttribute
          Contains all possible logger types.
static class GroboInstrumentTask.LoggerProperty
          Used for associating a key with a value for the properties.
 
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
GroboInstrumentTask()
           
 
Method Summary
 void addFileSet(org.apache.tools.ant.types.FileSet fs)
          Add a new fileset instance to this compilation.
 void addLoggerProp(GroboInstrumentTask.LoggerProperty lp)
          Adds a property to the logger properties file.
 void addMeasure(AnalysisModuleType amt)
          Creates a new analysis module.
 void execute()
          Perform the task
 void setDestDir(java.io.File f)
          Sets the directory in which all the recompiled class files will be placed.
 void setIfExists(GroboInstrumentTask.HandleExistingAttribute hea)
          Sets the behavior when classes get post-compiled - should the previous post-compiled class be replaced, kept, or should all the previous data be cleaned?
 void setLogDir(java.io.File f)
          Sets the directory in which all the data accumulated from the post compilation step will be placed, and the logging output as well.
 void setLogger(GroboInstrumentTask.LoggerAttribute la)
          Set the type of logger to use.
 void setLoggerFactory(java.lang.String name)
          Allow the user to specify a logger factory class name.
 
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

GroboInstrumentTask

public GroboInstrumentTask()
Method Detail

addFileSet

public void addFileSet(org.apache.tools.ant.types.FileSet fs)
Add a new fileset instance to this compilation. Whatever the fileset is, only filename that are .class will be considered as 'candidates'. Currently, jar files are not read; you'll have to uncompress them to a directory before running this step.

Parameters:
fs - the new fileset containing the rules to get the testcases.

setLogger

public void setLogger(GroboInstrumentTask.LoggerAttribute la)
Set the type of logger to use. This defaults to the "safe" logger, which is JDK agnostic.


setLoggerFactory

public void setLoggerFactory(java.lang.String name)
Allow the user to specify a logger factory class name. If this is specified, it overrides any value set by the "logger" attribute.


setLogDir

public void setLogDir(java.io.File f)
Sets the directory in which all the data accumulated from the post compilation step will be placed, and the logging output as well. This should be a directory dedicated just to the output data. If the directory doesn't exist when the task runs, it will be created.


setDestDir

public void setDestDir(java.io.File f)
Sets the directory in which all the recompiled class files will be placed. This directory should never be confused with the original class file location.


addMeasure

public void addMeasure(AnalysisModuleType amt)
Creates a new analysis module.


addLoggerProp

public void addLoggerProp(GroboInstrumentTask.LoggerProperty lp)
Adds a property to the logger properties file.


setIfExists

public void setIfExists(GroboInstrumentTask.HandleExistingAttribute hea)
Sets the behavior when classes get post-compiled - should the previous post-compiled class be replaced, kept, or should all the previous data be cleaned?


execute

public void execute()
             throws org.apache.tools.ant.BuildException
Perform the task

Throws:
org.apache.tools.ant.BuildException


Copyright © 2001-2003 by The GroboUtils Project