Skip to content

Commit

Permalink
add makefile to help updating protomodels and metadatas (ttacon#51) (t…
Browse files Browse the repository at this point in the history
…tacon#53)

update to upstream f9e9424769964ce1970c6ed2bd60b25b976dfe6f (>8.4.3)
  • Loading branch information
ttacon authored Jun 10, 2017
1 parent 2941e14 commit f9c5ddf
Show file tree
Hide file tree
Showing 6 changed files with 12,497 additions and 11,743 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.cov
*.cov
vendor/
google_libphonenumber/
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
WHOAMI=$(shell whoami)

SED_I = sed -i
ifeq ($(shell uname -s), Darwin)
SED_I = sed -i ''
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)
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

distupdate:
rm -rf ./google_libphonenumber
git clone --depth 1 https://github.com/googlei18n/libphonenumber.git ./google_libphonenumber/

update: distupdate generate
Loading

0 comments on commit f9c5ddf

Please sign in to comment.