public final class ZserioTask
extends org.apache.tools.ant.Task
With the contained classpath element the task solves a severe issue:
Zserio is loaded during execution time of this target rather than ant's bootstrapping. This has a simple reason: Ant loads all its classes during bootstrapping. If we would just use ant's classpath, we could not load zserio since it is created by the task just before test-classes are called. We avoid this situation by allowing the task to have its own classpath.
Supported syntax:
<zserio srcPath="src/path" srcFile="zs/all.zs" ignoreError="true" extraArgs="-option1 -option2">
<arg name="cmdlineOption" value="value"/>
<arg name="anotherOption"/>
<classpath>
path-like-structure
</classpath>
</zserio>
Supported attributes of the zserio task:
srcPath="path"
Path to source files.
srcFile="file"
Path to the input file, relative to srcPath.
ignoreError="true"
Do not report Zserio compilation error to Ant. Default is false.
extraArgs="-option1 -option2"
Extra zserio options in the same format as given by command line.
The options "srcPath" and "srcFile" are required. All the others are optional and can occur in any combination.
Supported children nodes:
<arg name="name" value="value"/>
Optional. Adds a custom option of the form "-name=value" or "-name" if value is not specified.
<classpath>path-like-structure</classpath>
Optional. Classpath used to locate and run Zserio Tool. It must include both the zserio_core.jar and
all the required libraries (e.g. antlr.jar) and plugins (e.g. zserio_java.jar).
| Constructor and Description |
|---|
ZserioTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
addClasspath(org.apache.tools.ant.types.Path classpath) |
ZserioTask |
clone() |
Argument |
createArg() |
void |
execute()
This method is called from ant to execute the task.
|
void |
setExtraArgs(java.lang.String extraArgs) |
void |
setIgnoreError(boolean ignoreError) |
void |
setSrcFile(java.lang.String srcFile) |
void |
setSrcPath(java.io.File srcPath) |
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic ZserioTask clone() throws java.lang.CloneNotSupportedException
clone in class org.apache.tools.ant.ProjectComponentjava.lang.CloneNotSupportedExceptionpublic void setSrcFile(java.lang.String srcFile)
public void setSrcPath(java.io.File srcPath)
public void setIgnoreError(boolean ignoreError)
public void setExtraArgs(java.lang.String extraArgs)
public void addClasspath(org.apache.tools.ant.types.Path classpath)
public Argument createArg()
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildExceptionLast updated 2024-07-18 11:27:44