Makefile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. CFLAGS = -Xcc -ISources/BoringSSL/include
  2. all:
  3. swift build -v $(CFLAGS)
  4. cp .build/debug/protoc-gen-swift .
  5. cp .build/debug/protoc-gen-swiftgrpc .
  6. project:
  7. swift package generate-xcodeproj
  8. test: all
  9. swift test -v $(CFLAGS)
  10. test-echo: all
  11. cp .build/debug/Echo .
  12. ./Echo serve & /bin/echo $$! > echo.pid
  13. ./Echo get | tee test.out
  14. ./Echo expand | tee -a test.out
  15. ./Echo collect | tee -a test.out
  16. ./Echo update | tee -a test.out
  17. kill -9 `cat echo.pid`
  18. diff -u test.out Sources/Examples/Echo/test.gold
  19. test-plugin: all
  20. protoc Sources/Examples/Echo/echo.proto --proto_path=Sources/Examples/Echo --plugin=.build/debug/protoc-gen-swift --plugin=.build/debug/protoc-gen-swiftgrpc --swiftgrpc_out=/tmp --swiftgrpc_opt=TestStubs=true
  21. diff -u /tmp/echo.grpc.swift Sources/Examples/Echo/Generated/echo.grpc.swift
  22. clean:
  23. rm -rf Packages
  24. rm -rf .build
  25. rm -rf SwiftGRPC.xcodeproj
  26. rm -rf Package.pins Package.resolved
  27. rm -rf protoc-gen-swift protoc-gen-swiftgrpc
  28. cd Examples/Echo/PackageManager; make clean
  29. cd Examples/Simple/PackageManager; make clean