Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. all:
  2. swift build
  3. cp .build/debug/protoc-gen-swift .
  4. cp .build/debug/protoc-gen-swiftgrpc .
  5. plugin:
  6. swift build --product protoc-gen-swift -c release
  7. swift build --product protoc-gen-swiftgrpc -c release
  8. cp .build/release/protoc-gen-swift .
  9. cp .build/release/protoc-gen-swiftgrpc .
  10. project:
  11. swift package generate-xcodeproj --output GRPC.xcodeproj
  12. @-ruby fix-project-settings.rb GRPC.xcodeproj || echo "Consider running 'sudo gem install xcodeproj' to automatically set correct indentation settings for the generated project."
  13. test:
  14. swift test
  15. test-plugin:
  16. swift build --product protoc-gen-swiftgrpc
  17. 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
  18. diff -u /tmp/echo.grpc.swift Sources/Examples/Echo/Generated/echo.grpc.swift
  19. test-generate-linuxmain:
  20. ifeq ($(UNAME_S), Darwin)
  21. swift test --generate-linuxmain
  22. @git diff --exit-code */LinuxMain.swift */XCTestManifests.swift > /dev/null || { echo "Generated tests are out-of-date; run 'swift test --generate-linuxmain' to update them!"; exit 1; }
  23. else
  24. echo "test-generate-linuxmain is only available on Darwin"
  25. endif
  26. clean:
  27. -rm -rf Packages
  28. -rm -rf .build build
  29. -rm -rf GRPC.xcodeproj
  30. -rm -rf Package.pins Package.resolved
  31. -rm -rf protoc-gen-swift protoc-gen-swiftgrpc
  32. -cd Examples/Google/Datastore && make clean
  33. -cd Examples/Google/NaturalLanguage && make clean
  34. -cd Examples/Google/Spanner && make clean