org.hydrateframework.ant
Class Generate
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.hydrateframework.ant.Generate
public class Generate
- extends org.apache.tools.ant.Task
This ant task is used to generate source code from an Hydrate definition file.
In order to use this task, include something like the following at the top
of your ant build.xml file:
<typedef name="hydrate" classname="org.hydrateframework.ant.Generate"
classpath="lib\hydrate.jar"/>
Then write a target for the code generation:
<target name="generate" depends="init">
<hydrate file="src\MyClasses.xml" output="gen" utils="src" sqldialect="DB2">
<classpath refid="project.classpath"/>
</hydrate>
</target>
Permitted attributes are:
- file - the name of the definition file (required)
- output - the name of the output directory (defaults to .)
- utils - the name of the utility files output directory.
You don't normally want to delete the files in this directory on
project clean, and they should probably be checked into source control.
This defaults to the same directory as output.
- sqldialect - the dialect of SQL used to write queries - the following are
supported: ANSI SQL-99 (default), DB2.
- classpath - this nested attribute needs to provide the hydrate code as
well as XML serialization libraries.
- fork - true to fork the code generation process. This is needed where the code
generation process depends on classes compiled earlier in the build script so that the
correct classpath is picked up.
- debug - true to turn on additional debugging information
- generateList - a comma separated list indicating which code generators to run. This list
may contain any of the following tags: (assemblers, enumerations, family, implement, indexes,
interfaces, schema, basic, XML, comparators). It may also contain fully qualified class
names of additional user-supplied code generators to run.
- Version:
- @(#)$Revision: 1.7 $
- Author:
- David Chamberlin
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 |
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 |
Generate
public Generate()
main
public static void main(java.lang.String[] args)
setFork
public void setFork(boolean fork)
setProjectBaseDir
public void setProjectBaseDir(java.lang.String dir)
setDebug
public void setDebug(boolean debug)
setFamily
public void setFamily(java.lang.String name)
setFile
public void setFile(java.lang.String name)
setFamilyClass
public void setFamilyClass(java.lang.String name)
setGenerateList
public void setGenerateList(java.lang.String name)
setOutput
public void setOutput(java.lang.String dir)
setUtils
public void setUtils(java.lang.String dir)
setSQLDialect
public void setSQLDialect(java.lang.String dialect)
addClasspath
public void addClasspath(org.apache.tools.ant.types.Path path)
doFork
public void doFork()
throws org.apache.tools.ant.BuildException
- Throws:
org.apache.tools.ant.BuildException
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
Copyright © 2000 The Hydrate Project. All Rights Reserved.