org.quattor.ant
Class PanCompilerTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.quattor.ant.PanCompilerTask
All Implemented Interfaces:
java.lang.Cloneable

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

An ant task which permits calling the pan compiler from an ant build file. This task allows all of the compiler parameters to be accessed and will optionally check dependency files before starting a build. See individual setter methods for the parameters which can be used in the build file.

Author:
loomis

Field Summary
protected static java.lang.String debugIndent
           
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
PanCompilerTask()
           
 
Method Summary
 void addConfiguredDebug(DebugPatterns debugPatterns)
          Add the include and exclude patterns for selectively enabling/disabling the debugging functions (debug() and traceback()).
 void addConfiguredFileSet(org.apache.tools.ant.types.FileSet fileset)
          Support nested fileset elements.
 void addConfiguredPath(org.apache.tools.ant.types.Path path)
          Support nested path elements.
 void execute()
           
 int getBatchSize()
           
 int getNthread()
          Return the number of threads used to compile the profiles.
 void setAnnotationBaseDirectory(java.io.File annotationBaseDirectory)
          Set the directory base directory to use for relative paths for annotation output files.
 void setAnnotationDirectory(java.io.File annotationDirectory)
          Set the directory in which the produced annotation files should be saved.
 void setBatchSize(int batchSize)
           
 void setCallDepthLimit(int callDepthLimit)
          The pan compiler can limit the call depth to avoid infinite recursion.
 void setCheckDependencies(boolean checkDependencies)
          This any task can check machine profile dependencies to avoid processing machine profiles which are already up-to-date.
 void setDebugTask(int debugTask)
          Setting this flag will print debugging information from the task itself.
 void setDeprecationLevel(int deprecationLevel)
          Level at which deprecation warnings are issued.
 void setDepWriteEnabled(boolean depWriteEnabled)
          Setting this flag will cause the compiler to write dependency files for the processed object templates.
 void setFailOnWarn(boolean failOnWarn)
          Flag to indicate whether or not warnings should be treated as errors.
 void setForceBuild(boolean forceBuild)
          Setting this option will force the compiler to build object templates even if the writing of the XML files and dependency files is turned off.
 void setFormatter(java.lang.String name)
          Define which formatter will be used to write the machine profiles to disk.
 void setGzipOutput(boolean gzipOutput)
          Indicate whether the produced machine profiles (if any) should be gzipped or not.
 void setIgnoreDependencyPattern(java.lang.String ignoreDependencyPattern)
          Dependencies that must be ignored when selecting the profiles to rebuild.
 void setIncludeRoot(java.io.File includeroot)
          Set the directory to use for the include globs.
 void setIncludes(java.lang.String includes)
          Set the include globs to use for the pan compiler loadpath.
 void setIterationLimit(int iterationLimit)
          The pan compiler allows an iteration limit to be set to avoid infinite loops.
 void setLogfile(java.io.File logfile)
          Set the log file to use for logging.
 void setLogging(java.lang.String loggingFlags)
          Enable the given types of logging.
 void setNthread(int nthread)
          Set the number of threads to use in each of three separate task queues.
 void setOutputDirectory(java.io.File outputDirectory)
          Set the output directory for generated machine profiles and dependency files.
 void setSessionDirectory(java.io.File sessionDirectory)
          Set the 'session' directory to be used for the compilation.
 void setVerbose(boolean verbose)
          Flag to indicate that extra information should be written to the standard output.
 void setXmlWriteEnabled(boolean xmlWriteEnabled)
          Setting this flag will cause the pan compiler to write machine templates to disk.
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugIndent

protected static final java.lang.String debugIndent
See Also:
Constant Field Values
Constructor Detail

PanCompilerTask

public PanCompilerTask()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

setIncludeRoot

public void setIncludeRoot(java.io.File includeroot)
Set the directory to use for the include globs. This is required only if the includes parameter is set.

Parameters:
includeroot - File giving the root directory for the include globs

setIncludes

public void setIncludes(java.lang.String includes)
Set the include globs to use for the pan compiler loadpath.

Parameters:
includes - String of comma- or space-separated file globs

addConfiguredPath

public void addConfiguredPath(org.apache.tools.ant.types.Path path)
Support nested path elements. This is called by ant only after all of the children of the path have been processed. These are the include directories to find non-object templates. Non-directory elements will be silently ignored.

Parameters:
path - a configured Path

addConfiguredFileSet

public void addConfiguredFileSet(org.apache.tools.ant.types.FileSet fileset)
Support nested fileset elements. This is called by ant only after all of the children of the fileset have been processed. Collect all of the selected files from the fileset.

Parameters:
fileset - a configured FileSet

setCallDepthLimit

public void setCallDepthLimit(int callDepthLimit)
The pan compiler can limit the call depth to avoid infinite recursion. This method sets a value for this limit. The default value is 50; non-positive numbers indicate no limit.

Parameters:
callDepthLimit -

setDebugTask

public void setDebugTask(int debugTask)
Setting this flag will print debugging information from the task itself. This is primarily useful if one wants to debug a build using the command line interface.

Parameters:
debugTask - flag to print task debugging information

addConfiguredDebug

public void addConfiguredDebug(DebugPatterns debugPatterns)
Add the include and exclude patterns for selectively enabling/disabling the debugging functions (debug() and traceback()). An embedded element without any attributes is treated as turning on all debugging. That is, it is the same as:

Parameters:
debugPatterns - configured instance with desired debug patterns

setDepWriteEnabled

public void setDepWriteEnabled(boolean depWriteEnabled)
Setting this flag will cause the compiler to write dependency files for the processed object templates.

Parameters:
depWriteEnabled - flag to generate dependency files

setIterationLimit

public void setIterationLimit(int iterationLimit)
The pan compiler allows an iteration limit to be set to avoid infinite loops. The default value is 5000 iterations; non-positive values indicate that no limit should be used.

Parameters:
iterationLimit - maximum number of permitted iterations

setOutputDirectory

public void setOutputDirectory(java.io.File outputDirectory)
Set the output directory for generated machine profiles and dependency files.

Parameters:
outputDirectory - directory for produced files

setSessionDirectory

public void setSessionDirectory(java.io.File sessionDirectory)
Set the 'session' directory to be used for the compilation. The session directory allows a parallel tree structure to be consulted before loading templates. This is useful to isolate changes from a pristine tree.

Parameters:
sessionDirectory - session directory to use for the build

setXmlWriteEnabled

public void setXmlWriteEnabled(boolean xmlWriteEnabled)
Setting this flag will cause the pan compiler to write machine templates to disk. The machine profiles are usually in an XML format; however, any defined formatter can be used.

Parameters:
xmlWriteEnabled -

setCheckDependencies

public void setCheckDependencies(boolean checkDependencies)
This any task can check machine profile dependencies to avoid processing machine profiles which are already up-to-date. Setting this flag allows the dependency checking to minimize the number of files which are built.

Parameters:
checkDependencies -

setFormatter

public void setFormatter(java.lang.String name)
Define which formatter will be used to write the machine profiles to disk. Valid values are "pan", "xmldb", "txt", or "dot".

Parameters:
name - name of formatter to use

setAnnotationDirectory

public void setAnnotationDirectory(java.io.File annotationDirectory)
Set the directory in which the produced annotation files should be saved.

Parameters:
annotationDirectory -

setAnnotationBaseDirectory

public void setAnnotationBaseDirectory(java.io.File annotationBaseDirectory)
Set the directory base directory to use for relative paths for annotation output files.

Parameters:
annotationBaseDirectory -

getNthread

public int getNthread()
Return the number of threads used to compile the profiles. Actually this is the number of threads to allow in each of three task queues.

Returns:
number of threads in each task queue

setNthread

public void setNthread(int nthread)
Set the number of threads to use in each of three separate task queues. A non-positive number will use the default value, which is the number of CPUs (or cores) available on the system.

Parameters:
nthread - number of threads per task queue

setVerbose

public void setVerbose(boolean verbose)
Flag to indicate that extra information should be written to the standard output. This gives the total number of files which will be processed and statistics coming from the compilation.

Parameters:
verbose -

setGzipOutput

public void setGzipOutput(boolean gzipOutput)
Indicate whether the produced machine profiles (if any) should be gzipped or not. The default is not to gzip output files.

Parameters:
gzipOutput - flag indicating whether to gzip output

setIgnoreDependencyPattern

public void setIgnoreDependencyPattern(java.lang.String ignoreDependencyPattern)
Dependencies that must be ignored when selecting the profiles to rebuild. Value must be a regular expression matching a (namespaced) template name. NOTE: Use of this option may cause incomplete builds. Use this option with extreme caution.

Parameters:
ignoreDependencyPattern - regular expression used to match namespaced template names to ignore

setDeprecationLevel

public void setDeprecationLevel(int deprecationLevel)
Level at which deprecation warnings are issued. If less than zero, then none are printed. If zero, warnings are issued for things that will change in next release. If greater than zero, then other future changes will be flagged.

Parameters:
deprecationLevel - level at which to give deprecation warnings

setFailOnWarn

public void setFailOnWarn(boolean failOnWarn)
Flag to indicate whether or not warnings should be treated as errors.

Parameters:
failOnWarn - setting the value true will cause compilations to fail on warnings

setForceBuild

public void setForceBuild(boolean forceBuild)
Setting this option will force the compiler to build object templates even if the writing of the XML files and dependency files is turned off.

Parameters:
forceBuild -

setLogging

public void setLogging(java.lang.String loggingFlags)
Enable the given types of logging. Note that NONE will take precedence over active logging flags and turn all logging off.

Parameters:
loggingFlags - a comma-separated list of logging types to enable

setLogfile

public void setLogfile(java.io.File logfile)
Set the log file to use for logging.

Parameters:
logfile - file to use for logging

getBatchSize

public int getBatchSize()

setBatchSize

public void setBatchSize(int batchSize)


Copyright © 2011 Quattor. All Rights Reserved.