Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. UNAME_S = $(shell uname -s)
  2. ifeq ($(UNAME_S),Linux)
  3. else
  4. CFLAGS = -Xcc -ISources/BoringSSL/include
  5. endif
  6. all:
  7. swift build -v $(CFLAGS)
  8. cp .build/debug/protoc-gen-swift .
  9. cp .build/debug/protoc-gen-swiftgrpc .
  10. project:
  11. swift package generate-xcodeproj
  12. @-ruby fix-project-settings.rb || echo "Consider running 'sudo gem install xcodeproj' to automatically set correct indentation settings for the generated project."
  13. test: all
  14. swift test -v $(CFLAGS)
  15. test-echo: all
  16. cp .build/debug/Echo .
  17. ./Echo serve & /bin/echo $$! > echo.pid
  18. ./Echo get | tee test.out
  19. ./Echo expand | tee -a test.out
  20. ./Echo collect | tee -a test.out
  21. ./Echo update | tee -a test.out
  22. kill -9 `cat echo.pid`
  23. diff -u test.out Sources/Examples/Echo/test.gold
  24. test-plugin:
  25. swift build -v $(CFLAGS) --product protoc-gen-swiftgrpc
  26. 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
  27. diff -u /tmp/echo.grpc.swift Sources/Examples/Echo/Generated/echo.grpc.swift
  28. clean:
  29. rm -rf Packages
  30. rm -rf .build
  31. rm -rf SwiftGRPC.xcodeproj
  32. rm -rf Package.pins Package.resolved
  33. rm -rf protoc-gen-swift protoc-gen-swiftgrpc
  34. cd Examples/Echo/PackageManager; make clean
  35. cd Examples/Simple/PackageManager; make clean