github.com/Finschia/finschia-sdk@v0.48.1/scripts/protocgen-any.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # This script generates a custom wrapper for google.protobuf.Any in
     4  # codec/types/any.pb.go with a custom generated struct that lives in
     5  # codec/types/any.go
     6  
     7  set -eo pipefail
     8  
     9  go install github.com/gogo/protobuf/protoc-gen-gogotypes
    10  
    11  buf protoc -I "third_party/proto" --gogotypes_out=./codec/types third_party/proto/google/protobuf/any.proto
    12  mv codec/types/google/protobuf/any.pb.go codec/types
    13  rm -rf codec/types/third_party
    14  
    15  # This removes the call to RegisterType in the custom generated Any wrapper
    16  # so that only the Any type provided by gogo protobuf is registered in the
    17  # global gogo protobuf type registry, which we aren't actually using
    18  sed '/proto\.RegisterType/d' codec/types/any.pb.go > tmp && mv tmp codec/types/any.pb.go