Open GoogleCodeExporter opened 8 years ago
I'm not familiar with FileDescriptorSet as output of protoc. I tried Googling
it and couldn't find anything useful. Can you please explain (or paste a link
that explains) how to configure protoc to do this?
Thanks!
-Alex
Original comment by alr...@google.com
on 25 Aug 2011 at 8:11
protoc supports the option
-oFILE, Writes a FileDescriptorSet (a protocol buffer,
--descriptor_set_out=FILE defined in descriptor.proto) containing all of
the input files to FILE.
Which creates a FileDescriptorSet protocol buffer which can then be read in and
used for dynamic message processing.
There is one compiler flag to indicate whether to include imports or not
--include_imports When using --descriptor_set_out, also include
all dependencies of the input files in the
set, so that the set is self-contained.
The output of the operation is a single file containing the specified
FileDescriptor protocol buffers as a FileDescriptorSet protocol buffer.
Here is an example call being made from ant...
[echo] Generating FileDescriptor for 'descriptor.proto'
[echo] Calling 'protoc.exe -I=./proto
--descriptor_set_out=gen-fdp/descriptor.proto.fds ./proto/descriptor.proto'
The only variations from the other build options are really the
--descriptor_set_out=<filename> and --include_imports
protoc.exe -I=./proto --descriptor_set_out=gen-fdp/descriptor.proto.fds
--include_imports ./proto/descriptor.proto
I've attached example output from protoc 2.4.0 for descriptor.proto
Original comment by compuwar...@gmail.com
on 25 Aug 2011 at 3:00
Attachments:
Also described in the protobuf documentation at
http://code.google.com/apis/protocolbuffers/docs/techniques.html#self-descriptio
n
Original comment by compuwar...@gmail.com
on 25 Aug 2011 at 3:02
Original comment by alr...@google.com
on 29 Aug 2011 at 7:20
Original comment by alr...@google.com
on 13 Sep 2011 at 10:22
Started work on this. I use the extension "fds" for descriptor set... does
something else make more sense?
fds = FileDescriptorSet (the top level proto in the file)
pds? = Protobuf Descriptor Set
Does anyone know of a common file extensions used for descriptor sets... or
even just protobuf data in general that is more appropriate?
Original comment by compuwar...@gmail.com
on 29 Sep 2011 at 7:00
What is the best way for me to deliver the changes? There are a significant
number of modified files to add the builder for Descriptor Set) and a few new
source files.
Previously I've just zipped up all the updated files... but is there a
different preferred way?
Original comment by compuwar...@gmail.com
on 29 Sep 2011 at 8:04
Modified:
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/Proto
bufBuildParticipant.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/Proto
cCommandFactory.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/BindingToCodeGeneration.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/CodeGenerationEditor.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/CodeGenerationSettings.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/CompilerPreferencePage.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/CompilerPreferences.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/CompilerPreferenceStoreInitializer.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/EditCodeGenerationDialog.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/Messages.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/RawPreferences.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/SupportedLanguage.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/Messages.properties
Added:
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/BindingToDescriptorSetGeneration.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/DescriptorSetGenerationSetting.java
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/EditDescriptorSetGenerationDialog.java
No tests added - I didn't see any applicable tests for the other builders...
correct me if I should create one or more test cases for the new builder.
Based off a pull from 'master' earlier today. I see there is another branch
for work on referenced options. If the files are much different for the
builders there let me know and I'll merge this into that first.
Original comment by compuwar...@gmail.com
on 29 Sep 2011 at 8:09
Attachments:
Postponing fix to next release.
Original comment by alr...@google.com
on 12 Oct 2011 at 6:04
Just checked this against the updated source for the upcoming 1.0.10 release
and there are no conflicts - should be easy to merge this for 1.0.11
Used the eclipse "wompare with" feature on the modified folders...
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/builder/
/com.google.eclipse.protobuf.ui/src/com/google/eclipse/protobuf/ui/preferences/p
ages/compiler/
Original comment by compuwar...@gmail.com
on 14 Oct 2011 at 5:46
Original comment by alr...@google.com
on 18 Oct 2011 at 7:58
Original comment by alr...@google.com
on 3 Nov 2011 at 1:06
Original comment by alr...@google.com
on 13 Jan 2012 at 3:20
Original comment by alr...@google.com
on 21 Oct 2012 at 9:13
Original issue reported on code.google.com by
compuwar...@gmail.com
on 24 Aug 2011 at 5:12