Actually, I'm going to have to address this pretty soon for my company as well. The biggest problem is compatibility between the different OSes. We don't have to worry about Windows, but we will have to support OSX, Linux, and probably Solaris for building .proto files. With static linking it's definitely possible to reduce the number of dependencies for the binary as shown on OSX below. I don't know how far we can go with static linking - I wasn't able to statically link libz which is a bit surprising. I think the correct solution will be to package 3 different binaries into our build system, switch on the OS, and invoke the proper protoc. I wish Google had written protoc in something like Python or Java rather than C++ to circumvent this problem, but I really can't complain about free, high quality software.
otool -L `which protoc` /usr/local/bin/protoc: /usr/local/lib/libprotobuf.4.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/local/lib/libprotoc.4.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4) otool -L src/protoc src/protoc: /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.5) On Tue, Aug 10, 2010 at 8:34 AM, Prakash Rao <prakashrao1...@gmail.com>wrote: > Hi, > Is there a way to automate java stub creation from .proto files using > ant task in all platforms? And can this be done without using > protoc.exe, which is platform specific? > > I saw the below ant task and it uses protoc.exe, which is only for > windows. > > <exec executable="protoc"> > <arg value="--java_out=outdir" /> > <arg value="--proto_path=srcdir" /> > <arg value="srcdir/path/to/input.proto" /> > </exec> > > And has any one tried this (or any other) ant task in windows/cygwin > to generate java stub from .proto files? > > Regards, > Prakash > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to proto...@googlegroups.com. > To unsubscribe from this group, send email to > protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.