Skip to content

Commit

Permalink
Makefile: update protobuf generation instructions
Browse files Browse the repository at this point in the history
The new instructions work with the latest protoc compiler, which
we can't use inside a Docker container anymore because the Docker
container is three years old and hasn't been updated since. The good
news is the compilation options have gotten much simpler, we don't
need to move files into place anymore.
  • Loading branch information
kevinburke1 committed Jun 4, 2021
1 parent 759f71f commit f43c7eb
Show file tree
Hide file tree
Showing 4 changed files with 14,371 additions and 13,105 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ endif
nothing:

generate_proto:
docker run --rm -v $(PWD):$(PWD) -w $(PWD) znly/protoc -I. --go_out=Mgoogle/protobuf/field_mask.proto=github.com/google/go-genproto/protobuf/field_mask,plugins=grpc:./ ./google_libphonenumber/resources/*.proto
mv ./google_libphonenumber/resources/*.pb.go ./
sudo chown -R $(WHOAMI) *
$(SED_I) -E 's/package i18n_phonenumbers/package libphonenumber/g' $(shell ls *.pb.go)
protoc -I. --go_out=. --go_opt=Mgoogle_libphonenumber/resources/phonemetadata.proto=../libphonenumber --go_opt=Mgoogle_libphonenumber/resources/phonenumber.proto=../libphonenumber ./google_libphonenumber/resources/*.proto
awk '/static const unsigned char/ { show=1 } show; /}/ { show=0 }' ./google_libphonenumber/cpp/src/phonenumbers/metadata.cc | tail -n +2 | sed '$$d' | sed -E 's/([^,])$$/\1,/g' | awk 'BEGIN{print "package libphonenumber\nvar metaData = []byte{"}; {print}; END{print "}"}' > metagen.go
go fmt ./metagen.go

Expand Down
Loading

0 comments on commit f43c7eb

Please sign in to comment.