org.wurbelizer
Class AntWurbiler

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.MatchingTask
              extended by org.wurbelizer.AntWurbiler
All Implemented Interfaces:
org.apache.tools.ant.types.selectors.SelectorContainer

public class AntWurbiler
extends org.apache.tools.ant.taskdefs.MatchingTask

Ant Task to invoke the DefaultWurbiler. This task will recursively scan the sourcedir looking for *.wrbl-files to wurbile.

Integrate into ant with:

   <taskdef name="wurbile" classname="org.wurbelizer.AntWurbiler"/>
 
Make sure that wurbelizer.jar is in the classpath of ant.


Field Summary
protected  boolean failOnError
           
protected  File[] wurbleList
           
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
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
AntWurbiler()
          Creates an instance of a wurbiler within ant.
 
Method Summary
protected  void checkParameters()
          Checks that all required attributes have been set and nothing silly has been entered.
 org.apache.tools.ant.types.Path createSrc()
          Creates a path for source compilation.
 void execute()
          Executes the task.
 File getDestdir()
          Gets the destination directory into which the java source files should be compiled.
 boolean getFailOnError()
          Gets the failonerror flag.
 File[] getFileList()
          Gets the list of files to be compiled.
 int getIndent()
          Gets the initial source indent.
 String getPackageName()
          Gets the packageName.
 String getParentClass()
          Gets the parent class.
 org.apache.tools.ant.types.Path getSrcdir()
          Gets the source dirs to find the source java files.
 boolean getVerbose()
          Gets the verbosity flag.
protected  org.apache.tools.ant.types.Path recreateSrc()
          Recreates a path for source compilation.
protected  void resetFileLists()
          Clears the list of files to be compiled and copied.
protected  void scanDir(File srcDir, String[] files)
          Scans the directory looking for source files to be wurbelized.
 void setDestdir(File destDir)
          Sets the destination directory into which the Java source files should be compiled.
 void setFailOnError(boolean fail)
          Indicates whether the build will continue even if there are compilation errors; defaults to true.
 void setIndent(int indent)
          Sets the initial source ident (leading spaces for compiled wurblet source) Default is 4.
 void setPackageName(String packageName)
          Sets the package name.
 void setParentClass(String parentClass)
          Sets the parent class.
 void setProceed(boolean proceed)
          Sets whether to proceed on error.
 void setSrcdir(org.apache.tools.ant.types.Path srcDir)
          Sets the source directories to find the source Java files.
 void setVerbose(boolean verbose)
          Sets the verbosity.
protected  void wurbile()
          Compiles the wurblets.
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

failOnError

protected boolean failOnError

wurbleList

protected File[] wurbleList
Constructor Detail

AntWurbiler

public AntWurbiler()
Creates an instance of a wurbiler within ant.

Method Detail

getVerbose

public boolean getVerbose()
Gets the verbosity flag.

Returns:
the verbose flag (true = verbose, false = default)

setVerbose

public void setVerbose(boolean verbose)
Sets the verbosity.

Parameters:
verbose - the verbosity, true = verbose, false = not.

getIndent

public int getIndent()
Gets the initial source indent. Defaults to 4.

Returns:
the source ident.

setIndent

public void setIndent(int indent)
Sets the initial source ident (leading spaces for compiled wurblet source) Default is 4.

Parameters:
indent - the source indent, -1 = default (4)

getParentClass

public String getParentClass()
Gets the parent class.

Returns:
the parent class, null = default (AbstractWurblet)

setParentClass

public void setParentClass(String parentClass)
Sets the parent class.

Parameters:
parentClass - the parent class, null = default (AbstractWurblet)

getPackageName

public String getPackageName()
Gets the packageName.

Returns:
the package name

setPackageName

public void setPackageName(String packageName)
Sets the package name.

Parameters:
packageName - the package name, null = default

createSrc

public org.apache.tools.ant.types.Path createSrc()
Creates a path for source compilation.

Returns:
a nested src element.

recreateSrc

protected org.apache.tools.ant.types.Path recreateSrc()
Recreates a path for source compilation.

Returns:
a nested src element.

setSrcdir

public void setSrcdir(org.apache.tools.ant.types.Path srcDir)
Sets the source directories to find the source Java files.

Parameters:
srcDir - the source directories as a path

getSrcdir

public org.apache.tools.ant.types.Path getSrcdir()
Gets the source dirs to find the source java files.

Returns:
the source directories as a path

setDestdir

public void setDestdir(File destDir)
Sets the destination directory into which the Java source files should be compiled.

Parameters:
destDir - the destination director

getDestdir

public File getDestdir()
Gets the destination directory into which the java source files should be compiled.

Returns:
the destination directory

setFailOnError

public void setFailOnError(boolean fail)
Indicates whether the build will continue even if there are compilation errors; defaults to true.

Parameters:
fail - if true halt the build on failure

setProceed

public void setProceed(boolean proceed)
Sets whether to proceed on error. This is the inverse of Failonerror.

Parameters:
proceed - true to proceed on error

getFailOnError

public boolean getFailOnError()
Gets the failonerror flag.

Returns:
the failonerror flag

execute

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

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException - if an error occurs

resetFileLists

protected void resetFileLists()
Clears the list of files to be compiled and copied.


scanDir

protected void scanDir(File srcDir,
                       String[] files)
Scans the directory looking for source files to be wurbelized. The results are returned in the class variable wurbleList.

Parameters:
srcDir - the source directory
files - the array of filenames

getFileList

public File[] getFileList()
Gets the list of files to be compiled.

Returns:
the list of files as an array

checkParameters

protected void checkParameters()
                        throws org.apache.tools.ant.BuildException
Checks that all required attributes have been set and nothing silly has been entered.

Throws:
org.apache.tools.ant.BuildException - if an error occurs

wurbile

protected void wurbile()
Compiles the wurblets.



Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de