ANT Task

840 views
Skip to first unread message

Robin Barooah

unread,
Jul 7, 2008, 9:02:51 PM7/7/08
to Protocol Buffers
I don't see an ANT task in the distribution. What's the preferred way
of running protoc in a java project, or am I missing something?

Kenton Varda

unread,
Jul 7, 2008, 9:11:11 PM7/7/08
to Robin Barooah, Protocol Buffers
For now, just use an <exec> task.  I think something like this works:

<exec executable="protoc">
  <arg value="--java_out=outdir" />
  <arg value="--proto_path=srcdir" />
  <arg value="srcdir/path/to/input.proto" />
</exec>

There are plans in the works for a Maven plugin for this.  It sounds like better ant support would be a good thing to add as well.

Robin Barooah

unread,
Jul 8, 2008, 2:07:14 AM7/8/08
to Protocol Buffers
Thanks - that will do fine as a stopgap.

On Jul 7, 6:11 pm, "Kenton Varda" <tempo...@gmail.com> wrote:
> For now, just use an <exec> task.  I think something like this works:
>
> <exec executable="protoc">
>   <arg value="--java_out=outdir" />
>   <arg value="--proto_path=srcdir" />
>   <arg value="srcdir/path/to/input.proto" />
> </exec>
>
> There are plans in the works for a Maven plugin for this.  It sounds like
> better ant support would be a good thing to add as well.
>

anjanBacchu

unread,
Jul 8, 2008, 6:40:39 PM7/8/08
to Protocol Buffers
" It sounds like
better ant support would be a good thing to add as well. "
+1

On Jul 7, 6:11 pm, "Kenton Varda" <tempo...@gmail.com> wrote:
> For now, just use an <exec> task.  I think something like this works:
>
> <exec executable="protoc">
>   <arg value="--java_out=outdir" />
>   <arg value="--proto_path=srcdir" />
>   <arg value="srcdir/path/to/input.proto" />
> </exec>
>
> There are plans in the works for a Maven plugin for this.  It sounds like
> better ant support would be a good thing to add as well.
>

Matthew Newhook

unread,
Jul 19, 2008, 7:19:19 AM7/19/08
to Protocol Buffers
I wrote an ant task as part of http://www.zeroc.com/labs/protobuf/index.html.
The task is part of the patch file for the download, which isn't all
that convenient. At any rate, you might want to check that out, and
see if it is useful for your project!

The files to look at are: java/demo/Ice/protobuf/ant/ProtocTask.java
for the task implemetation and java/demo/Ice/protobuf/build.xml for an
example.

Regards, Matthew

On Jul 8, 8:40 pm, anjanBacchu <anjan....@gmail.com> wrote:
> " It sounds like
> betterantsupport would be a good thing to add as well. "
> +1
>
> On Jul 7, 6:11 pm, "Kenton Varda" <tempo...@gmail.com> wrote:
>
> > For now, just use an <exec>task.  I think something like this works:
>
> > <exec executable="protoc">
> >   <arg value="--java_out=outdir" />
> >   <arg value="--proto_path=srcdir" />
> >   <arg value="srcdir/path/to/input.proto" />
> > </exec>
>
> > There are plans in the works for a Maven plugin for this.  It sounds like
> > betterantsupport would be a good thing to add as well.
>
> > On Mon, Jul 7, 2008 at 6:02 PM, Robin Barooah <robi...@gmail.com> wrote:
>
> > > I don't see anANTtaskin the distribution.  What's the preferred way

Dean Hiller

unread,
Apr 11, 2012, 4:26:07 PM4/11/12
to prot...@googlegroups.com
+1 ...we just got Access is Denied after checkout on someones window machine.  An ant task that doesn't call protoc.exe would be great (ie. the ant task should just run in java so it's protable without these issues that we are running into).

thanks,
Dean
Reply all
Reply to author
Forward
0 new messages