Status: New
Owner:
ken...@google.com
Labels: Type-Defect Priority-Medium
New issue 183 by t.broyer: --java_out=output_list_file= parameter fails
when compiling multiple proto files
http://code.google.com/p/protobuf/issues/detail?id=183
What steps will reproduce the problem?
Run protoc with multiple input files to generate Java and passing the
output_list_file parameter. For instance, derived from the command line
found in java/README.txt:
$ protoc --java_out=output_list_file=generated_files.txt:src/main/java \
-I../src ../src/google/protobuf/descriptor.proto \
../src/google/protobuf/compiler/plugin.proto
What is the expected output? What do you see instead?
generated.txt should contain the list of all generated files (in this case
two lines: com/google/protobuf/DescriptorProtos.java and
google/protobuf/compiler/PluginProtos.java), but instead protoc fails with
the following message:
generated_files.txt: Tried to write the same file twice.
What version of the product are you using? On what operating system?
2.3.0 on Windows XP (using the precompiled protoc.exe)
Please provide any additional information below.
This unfortunately is a flaw in the CodeGenerator architecture: a
CodeGenerator is called for each .proto file to generate and cannot
maintain state (in this case it would probably be the "vector<string>
all_files") between calls as there are no start/end hooks (to know when to
flush the list to the file).
The workaround is to invoke protoc repeatedly with only 1 .proto file and a
different output_list_file each time.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to
prot...@googlegroups.com.
To unsubscribe from this group, send email to
protobuf+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.