Package org.apache.torque.ant.task
Class TorqueGeneratorTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.torque.ant.task.TorqueGeneratorTask
- All Implemented Interfaces:
Cloneable
public class TorqueGeneratorTask
extends org.apache.tools.ant.Task
Executes a unit of generation within the torque generator.
ant goal generate
$Id: TorqueGeneratorTask.java 1917242 2024-04-21 13:30:19Z tv $-
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new option and adds it to the list of options.voidexecute()Runs the generation.voidsetAddDebuggingInfoToOutput(boolean addDebuggingInfoToOutput) Sets whether debugging information should be added to the output.voidsetCombineFiles(Boolean combineFiles) Sets whether all source files should be combined into one source tree.voidsetConfigDir(File configDir) voidsetConfigPackage(String configPackage) voidsetDefaultOutputDir(File defaultOutputDir) Sets the default output base directory for generated files.voidsetDefaultOutputEncoding(Charset defaultOutputCharset) Sets the encoding which should be used for the files which do not have an output encoding set in the templates.voidsetJarFile(String jarFile) The path to the jar file to use.voidsetLoglevel(String loglevel) Sets the Loglevel to use in the generation process.voidsetOutputDirMap(Map<String, File> outputDirMap) Sets the mapping from outputDirKey to output directories.voidsetOverrideConfigDir(File overrideConfigDir) Sets the config directory overriding the template settings.voidsetPackaging(String packaging) Sets the packaging.voidsetProjectRootDir(File projectRootDir) Sets the root directory of the project.voidsetRunOnlyOnSourceChange(boolean runOnlyOnSourceChange) Sets whether the generator should only run if one of the source files changes.voidsetSourceDir(File sourceDir) Sets the directory in which the source files are located.voidsetSourceExcludes(Set<String> sourceExcludes) Sets the pattern which files are excluded in the generation process.voidsetSourceIncludes(Set<String> sourceIncludes) Sets the pattern which files are included in the generation process.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, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
TorqueGeneratorTask
public TorqueGeneratorTask()
-
-
Method Details
-
createOption
Creates a new option and adds it to the list of options.- Returns:
- the newly created option.
-
execute
public void execute() throws org.apache.tools.ant.BuildExceptionRuns the generation.- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
setPackaging
Sets the packaging.- Parameters:
packaging- the packaging, either "jar" or "directory"
-
setProjectRootDir
Sets the root directory of the project.- Parameters:
projectRootDir- the project root Directory.
-
setConfigDir
-
setConfigPackage
-
setDefaultOutputDir
Sets the default output base directory for generated files.- Parameters:
defaultOutputDir- the default output directory, or null to use the default.
-
setOutputDirMap
Sets the mapping from outputDirKey to output directories. The outputDirKeys are defined in the templates you use.- Parameters:
outputDirMap- the new outputDirMap.
-
setJarFile
The path to the jar file to use.- Parameters:
jarFile- the jar file, or null.
-
setSourceDir
Sets the directory in which the source files are located.- Parameters:
sourceDir- the directory in which the source files are located.
-
setSourceIncludes
Sets the pattern which files are included in the generation process.- Parameters:
sourceIncludes- a list containing the include patterns, or null if no include pattern should be used.
-
setSourceExcludes
Sets the pattern which files are excluded in the generation process.- Parameters:
sourceExcludes- a list containing the exclude patterns, or null if no exclude pattern should be used.
-
setOverrideConfigDir
Sets the config directory overriding the template settings. If set, the settings of this directory are used as "child" and the "normal" settings are used as "parent".- Parameters:
overrideConfigDir- the config directory overriding the template settings, or null if the template settings will not be overridden.
-
setLoglevel
Sets the Loglevel to use in the generation process.- Parameters:
loglevel- the loglevel, must be one of trace, debug, info, warn or error, or null if the loglevel defined in the templates should be used.
-
setAddDebuggingInfoToOutput
public void setAddDebuggingInfoToOutput(boolean addDebuggingInfoToOutput) Sets whether debugging information should be added to the output.- Parameters:
addDebuggingInfoToOutput- true if debugging information should be added to the output, false otherwise.
-
setRunOnlyOnSourceChange
public void setRunOnlyOnSourceChange(boolean runOnlyOnSourceChange) Sets whether the generator should only run if one of the source files changes. The default value is false.- Parameters:
runOnlyOnSourceChange- true if the generator should only run if one of the source files changes, false if it should always run irrespective of changes in the source files.
-
setDefaultOutputEncoding
Sets the encoding which should be used for the files which do not have an output encoding set in the templates.- Parameters:
defaultOutputCharset- the default output encoding, or null to use the generator default (the platform default encoding).
-
setCombineFiles
Sets whether all source files should be combined into one source tree. If false, each source file will be read in its own source tree and start a new generation run. If true, a single source tree with the following structure will be built from all source files: <source> <file path="path/to/file1"> <rootOfFile1> ... </rootOfFile1> </file> <file path="path/to/file2"> <rootOfFile2> ... </rootOfFile2> </file> ... </source> If not set, the settings from the templates will be used.- Parameters:
combineFiles- whether all sources should be combined.
-