Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. # Optional: set the generated project's indentation settings.
  9. -ruby fix-indentation-settings.rb || echo "Consider running 'sudo gem install xcodeproj' to automatically set correct indentation settings for the generated project."
  10. test: all
  11. swift test -v $(CFLAGS)
  12. test-echo: all
  13. cp .build/debug/Echo .
  14. ./Echo serve & /bin/echo $$! > echo.pid
  15. ./Echo get | tee test.out
  16. ./Echo expand | tee -a test.out
  17. ./Echo collect | tee -a test.out
  18. ./Echo update | tee -a test.out
  19. kill -9 `cat echo.pid`
  20. diff -u test.out Sources/Examples/Echo/test.gold
  21. test-plugin:
  22. swift build -v $(CFLAGS) --product protoc-gen-swiftgrpc
  23. 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
  24. diff -u /tmp/echo.grpc.swift Sources/Examples/Echo/Generated/echo.grpc.swift
  25. clean:
  26. rm -rf Packages
  27. rm -rf .build
  28. rm -rf SwiftGRPC.xcodeproj
  29. rm -rf Package.pins Package.resolved
  30. rm -rf protoc-gen-swift protoc-gen-swiftgrpc
  31. cd Examples/Echo/PackageManager; make clean
  32. cd Examples/Simple/PackageManager; make clean