views:

47

answers:

1

Anyone can show me a pointer about how to write ant rules (build.xml) for creating a .jar file from a .proto file?

Basically, I have write a legitimate example.proto and I can use the command line to compiled output java file: Struct.java internalStruct.java.

What I want is to write an ant rule to automate the above process. Any existing read? Or can someone share some code snippet for a starting point?

A: 

It sounds like you need the Ant Exec task to execute the binary to create the .java from the .proto files. The Javac task will then compile these and the Jar task builds your .jar file.

How do you tie all this together ? This tutorial introduces Ant and how to make use of tasks like the above.

Brian Agnew