org.schmidmeier.protocolbuffer.ant
Class PbTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.schmidmeier.protocolbuffer.ant.PbTask
All Implemented Interfaces:
java.lang.Cloneable

public class PbTask
extends org.apache.tools.ant.Task

The Anttask for the protocol buffer library. It has following attributes

Attributes

Attribute Description Required
java if set, output will be generated for java. The value must be the java output directory at least on of java, python, cpp
cpp if set, output will be generated for C++. The value must be the C++ output directory at least on of java, python, cpp
python if set, output will be generated for python. The value must be the python output directory at least on of java, python, cpp
ipath The directory which may contain include files No, default unset
failonerror if set, the compilation aborts in case of errors No, Default, true
protopathentry The possibility to add multiple include file to the command line No, Required unset



A sample is task may look like

<pb ProtoFile="Sample.proto" 
        java="${java_output}" 
        ipath="C:/workspace_3.4/ProtobuffersAntTask">
                <protopathentry ipath="${inc1.dir}"/>
                <protopathentry ipath="${inc2.dir}"/>
</pb>

 

Since:
2008-08-16
Author:
Arno Schmidmeier

Nested Class Summary
 class PbTask.ProtoPathEntry
           
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
PbTask()
           
 
Method Summary
 PbTask.ProtoPathEntry createProtoPathEntry()
           
 void execute()
          Do the work.
 void setCpp(java.io.File cpp)
           
 void setFailOnError(boolean failonerror)
           
 void setIPath(java.io.File iPath)
           
 void setJava(java.io.File java)
           
 void setProtoFile(java.io.File protoFile)
           
 void setPython(java.io.File python)
           
 
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
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PbTask

public PbTask()
Method Detail

setFailOnError

public void setFailOnError(boolean failonerror)

setIPath

public void setIPath(java.io.File iPath)

setJava

public void setJava(java.io.File java)

setCpp

public void setCpp(java.io.File cpp)

setPython

public void setPython(java.io.File python)

setProtoFile

public void setProtoFile(java.io.File protoFile)

execute

public void execute()
Do the work.

Overrides:
execute in class org.apache.tools.ant.Task

createProtoPathEntry

public PbTask.ProtoPathEntry createProtoPathEntry()


Copyright © 2008 Arno Schmidmeier