diff --git a/protobuf/Makefile b/protobuf/Makefile index 33c1f855e..d7b4c47b7 100644 --- a/protobuf/Makefile +++ b/protobuf/Makefile @@ -1,8 +1,7 @@ -# Assumes you've installed protobug-objc -# see: https://github.com/alexeyxo/protobuf-objc +# See README.md in this dir for prerequisite setup. PROTOC=protoc \ - --plugin=/usr/local/bin/proto-gen-objc \ + --plugin=/usr/local/bin/protoc-gen-objc \ --proto_path="${HOME}/src/WhisperSystems/protobuf-objc/src/compiler/" \ --proto_path="${HOME}/src/WhisperSystems/protobuf-objc/src/compiler/google/protobuf/" \ --proto_path='./' diff --git a/protobuf/README.md b/protobuf/README.md new file mode 100644 index 000000000..c78eb9b87 --- /dev/null +++ b/protobuf/README.md @@ -0,0 +1,38 @@ +# SignalServiceKit Protobufs + +These protobuf definitions are copied from Signal-Android, but modified +to include a conventional ObjC classnames. + +e.g. + + import "objectivec-descriptor.proto"; + option (google.protobuf.objectivec_file_options).class_prefix = "OWSFingerprintProtos"; + +## Prequisites + +Install protobuf 2.6, the objc plugin doesn't currently work with +protobuf 3.0 + + brew install protobuf@2.6 + # Beware if you are depending on protobuf 3.0 elsewhere + brew link --force protobuf@2.6 + +Install the objc plugin to $SignalServiceKitRoot/.. + +e.g. I have SignalServiceKit installed to ~/src/WhisperSystems/SignalServiceKit + +So I run + + cd ~/src/WhisperSystems + git clone https://github.com/alexeyxo/protobuf-objc + +Follow the install instructions at https://github.com/alexeyxo/protobuf-objc + +## Building Protobuf + +After changes are made to any proto, generate the ObjC classes by +running: + + cd ~/src/WhisperSystems/SignalServiceKit/protobuf + make +