dvdkruk / protobuf-dt

Automatically exported from code.google.com/p/protobuf-dt
0 stars 0 forks source link

No builder for FileDescriptorSet proto #101

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a project
2. Open the builders dialog - observe that there are options for C, Java, 
Python but not for FileDescriptorSet
3.

What is the expected output? What do you see instead?
Available builder for FileDescriptorSet proto files

What version of the product are you using? On what operating system?
1.0.0

Please provide any additional information below.

Original issue reported on code.google.com by compuwar...@gmail.com on 24 Aug 2011 at 5:12

GoogleCodeExporter commented 9 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

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago

Original comment by alr...@google.com on 29 Aug 2011 at 7:20

GoogleCodeExporter commented 9 years ago

Original comment by alr...@google.com on 13 Sep 2011 at 10:22

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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:

GoogleCodeExporter commented 9 years ago
Postponing fix to next release.

Original comment by alr...@google.com on 12 Oct 2011 at 6:04

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago

Original comment by alr...@google.com on 18 Oct 2011 at 7:58

GoogleCodeExporter commented 9 years ago

Original comment by alr...@google.com on 3 Nov 2011 at 1:06

GoogleCodeExporter commented 9 years ago

Original comment by alr...@google.com on 13 Jan 2012 at 3:20

GoogleCodeExporter commented 9 years ago

Original comment by alr...@google.com on 21 Oct 2012 at 9:13