public class GeneratorAntTask
extends org.apache.tools.ant.Task
<project default="genfiles" basedir=".">
<property name="generated.source.dir" value="${basedir}" />
<target name="genfiles" description="Generate the files">
<taskdef name="mbgenerator"
classname="org.mybatis.generator.ant.GeneratorAntTask"
classpath="mybatis-generator-core-x.x.x.jar" />
<mbgenerator overwrite="true" configfile="generatorConfig.xml" verbose="false" >
<propertyset>
<propertyref name="generated.source.dir"/>
</propertyset>
</mbgenerator>
</target>
</project>
The task requires that the attribute "configFile" be set to an existing XML
configuration file.
The task supports these optional attributes:
| 构造器和说明 |
|---|
GeneratorAntTask() |
| 限定符和类型 | 方法和说明 |
|---|---|
org.apache.tools.ant.types.PropertySet |
createPropertyset() |
void |
execute() |
String |
getConfigfile() |
String |
getContextIds() |
String |
getFullyQualifiedTableNames() |
boolean |
isOverwrite() |
boolean |
isVerbose() |
void |
setConfigfile(String configfile) |
void |
setContextIds(String contextIds) |
void |
setFullyQualifiedTableNames(String fullyQualifiedTableNames) |
void |
setOverwrite(boolean overwrite) |
void |
setVerbose(boolean verbose) |
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic void execute()
throws org.apache.tools.ant.BuildException
execute 在类中 org.apache.tools.ant.Taskorg.apache.tools.ant.BuildExceptionpublic String getConfigfile()
public void setConfigfile(String configfile)
configfile - The configfile to set.public boolean isOverwrite()
public void setOverwrite(boolean overwrite)
overwrite - The overwrite to set.public org.apache.tools.ant.types.PropertySet createPropertyset()
public boolean isVerbose()
public void setVerbose(boolean verbose)
public String getContextIds()
public void setContextIds(String contextIds)
public String getFullyQualifiedTableNames()
public void setFullyQualifiedTableNames(String fullyQualifiedTableNames)
Copyright © 2006–2016 MyBatis.org. All rights reserved.