Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. .PHONY: log protos generate clean help
  2. log: help
  3. ## protos : Pull protos from Google Repository
  4. protos:
  5. curl -L -O https://github.com/googleapis/googleapis/archive/master.zip
  6. unzip master.zip
  7. rm -f master.zip
  8. mv googleapis-master googleapis
  9. ## generate : Take the cloned .proto files and generate swift using the protoc plugin
  10. generate:
  11. protoc \
  12. googleapis/google/cloud/speech/v1/cloud_speech.proto \
  13. googleapis/google/cloud/speech/v1/resource.proto \
  14. googleapis/google/rpc/status.proto \
  15. googleapis/google/api/client.proto \
  16. googleapis/google/api/annotations.proto \
  17. googleapis/google/api/http.proto \
  18. googleapis/google/longrunning/operations.proto \
  19. -Igoogleapis \
  20. --swift_out=Visibility=Public:. \
  21. --grpc-swift_out=Visibility=Public,Client=true,Server=false:.
  22. mkdir -p Sources/Generated
  23. find google/ -name \*.swift -exec cp {} Sources/Generated/ \;
  24. ## clean : Clean workspace and start from scratch (remove googleapis, generated swift, etc.)
  25. clean:
  26. rm -rf googleapis/
  27. rm -rf google/
  28. rm Sources/Generated/*
  29. help: Makefile
  30. sed -n "s/^##//p" $<