*: Protocol Buffer docs auto-generate script

This commit is contained in:
Gyu-Ho Lee
2016-04-21 16:56:19 -07:00
parent 0c191b71ec
commit 753630dc37
2 changed files with 800 additions and 0 deletions

View File

@@ -56,3 +56,32 @@ for dir in ${DIRS}; do
goimports -w *.pb.go
popd
done
# install protodoc
# go get -v -u github.com/coreos/protodoc
#
# by default, do not run this option.
# only run when './scripts/genproto.sh -g'
#
if [ "$1" = "-g" ]; then
echo "protodoc is auto-generating Protocol Buffer documentation..."
go get -v -u github.com/coreos/protodoc
SHA_PROTODOC="4cd8db83c5595ac514169fda607d1ccb5eef669b"
PROTODOC_PATH="${GOPATH}/src/github.com/coreos/protodoc"
pushd "${PROTODOC_PATH}"
git reset --hard "${SHA_PROTODOC}"
go install
echo "protodoc is updated"
popd
protodoc --directories="etcdserver/etcdserverpb=service_message,storage/storagepb=service_message,lease/leasepb=service_message,auth/authpb=service_message" \
--title="Protocol Buffer API" \
--output="Documentation/api_reference_v3.md" \
--message-only-from-this-file="etcdserver/etcdserverpb/rpc.proto"
echo "protodoc is finished..."
else
echo "skipping Protocol Buffer document auto-generation..."
fi