protobuf-objc
protobuf-objc copied to clipboard
Are packages and options available?
Not sure if it is a bug or my dirty hands, but..
I followed these steps:
-
brew install protobuf
-
git clone <this repo>
-
./scripts/build.sh
- fill up all needed information for proto files.
- ( somewhere between previous steps: link
protoc
to correct folder/usr/local/bin
) ( Also I added project via cocoapods, but it doesn't matter )
Ok, I try to run protoc --plugin=/usr/local/bin/protoc-gen-objc *.proto --objc_out="./"
Several issues appeared.
First: Can't use options
package ponyprotobuffed;
import "objectivec-descriptor.proto";
option (google.protobuf.objectivec_file_options).package = "PonyProtobuffed";
option (google.protobuf.objectivec_file_options).class_prefix = "PNP";
option (google.protobuf.objectivec_file_options).relax_camel_case = true;
No luck with class prefix or package. These options not found. File "objectvicec-descriptor.proto" not found.
If I remove all options and leave only
option class_prefix="PNP"
or
option objc_class_prefix="PNP"
result is the same - no luck.
package doesn't work well (names aren't prefixed by package name).
Second: Can't use default value for enum.
enum PNPPonyProtobuffedPonyType {
Cute
Awesome
}
message Pony {
required PNPPonyProtobuffedPonyType ponyType = 2 [default = PNPPonyProtobuffedPonyTypeCute]
}
Unknown value PNPPonyProtobuffedPonyTypeCute
or Cute
.