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.
$Id: TorqueGeneratorTask.java 1850971 2019-01-10 18:14:54Z painter $ant goal generate
-
-
Constructor Summary
Constructors Constructor Description TorqueGeneratorTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Option
createOption()
Creates a new option and adds it to the list of options.void
execute()
Runs the generation.void
setAddDebuggingInfoToOutput(boolean addDebuggingInfoToOutput)
Sets whether debugging information should be added to the output.void
setCombineFiles(Boolean combineFiles)
Sets whether all source files should be combined into one source tree.void
setConfigDir(File configDir)
void
setConfigPackage(String configPackage)
void
setDefaultOutputDir(File defaultOutputDir)
Sets the default output base directory for generated files.void
setDefaultOutputEncoding(String defaultOutputEncoding)
Sets the encoding which should be used for the files which do not have an output encoding set in the templates.void
setJarFile(String jarFile)
The path to the jar file to use.void
setLoglevel(String loglevel)
Sets the Loglevel to use in the generation process.void
setOutputDirMap(Map<String,File> outputDirMap)
Sets the mapping from outputDirKey to output directories.void
setOverrideConfigDir(File overrideConfigDir)
Sets the config directory overriding the template settings.void
setPackaging(String packaging)
Sets the packaging.void
setProjectRootDir(File projectRootDir)
Sets the root directory of the project.void
setRunOnlyOnSourceChange(boolean runOnlyOnSourceChange)
Sets whether the generator should only run if one of the source files changes.void
setSourceDir(File sourceDir)
Sets the directory in which the source files are located.void
setSourceExcludes(Set<String> sourceExcludes)
Sets the pattern which files are excluded in the generation process.void
setSourceIncludes(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, setTaskType
-
-
-
-
Method Detail
-
createOption
public Option 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.BuildException
Runs the generation.- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
-
setPackaging
public void setPackaging(String packaging)
Sets the packaging.- Parameters:
packaging
- the packaging, either "jar" or "directory"
-
setProjectRootDir
public void setProjectRootDir(File projectRootDir)
Sets the root directory of the project.- Parameters:
projectRootDir
- the project root Directory.
-
setConfigDir
public void setConfigDir(File configDir)
-
setConfigPackage
public void setConfigPackage(String configPackage)
-
setDefaultOutputDir
public void setDefaultOutputDir(File defaultOutputDir)
Sets the default output base directory for generated files.- Parameters:
defaultOutputDir
- the default output directory, or null to use the default.
-
setOutputDirMap
public void setOutputDirMap(Map<String,File> outputDirMap)
Sets the mapping from outputDirKey to output directories. The outputDirKeys are defined in the templates you use.- Parameters:
outputDirMap
- the new outputDirMap.
-
setJarFile
public void setJarFile(String jarFile)
The path to the jar file to use.- Parameters:
jarFile
- the jar file, or null.
-
setSourceDir
public void setSourceDir(File sourceDir)
Sets the directory in which the source files are located.- Parameters:
sourceDir
- the directory in which the source files are located.
-
setSourceIncludes
public void setSourceIncludes(Set<String> sourceIncludes)
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
public void setSourceExcludes(Set<String> sourceExcludes)
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
public void setOverrideConfigDir(File overrideConfigDir)
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
public void setLoglevel(String loglevel)
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
public void setDefaultOutputEncoding(String defaultOutputEncoding)
Sets the encoding which should be used for the files which do not have an output encoding set in the templates.- Parameters:
defaultOutputEncoding
- the default output encoding, or null to use the generator default (the platform default encoding).
-
setCombineFiles
public void setCombineFiles(Boolean combineFiles)
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.
-
-