2
0

generate.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. PLUGIN_SWIFT=../../.build/debug/protoc-gen-swift
  3. PLUGIN_SWIFTGRPC=../../.build/debug/protoc-gen-swiftgrpc
  4. PROTO="src/proto/grpc/testing/test.proto"
  5. OUTPUT="Generated"
  6. FILE_NAMING="DropPath"
  7. VISIBILITY="Public"
  8. protoc "src/proto/grpc/testing/test.proto" \
  9. --plugin=${PLUGIN_SWIFT} \
  10. --plugin=${PLUGIN_SWIFTGRPC} \
  11. --swift_out=${OUTPUT} \
  12. --swift_opt=FileNaming=${FILE_NAMING},Visibility=${VISIBILITY} \
  13. --swiftgrpc_out=${OUTPUT} \
  14. --swiftgrpc_opt=FileNaming=${FILE_NAMING},Visibility=${VISIBILITY}
  15. protoc "src/proto/grpc/testing/empty.proto" \
  16. --plugin=${PLUGIN_SWIFT} \
  17. --plugin=${PLUGIN_SWIFTGRPC} \
  18. --swift_out=${OUTPUT} \
  19. --swift_opt=FileNaming=${FILE_NAMING},Visibility=${VISIBILITY} \
  20. --swiftgrpc_out=${OUTPUT} \
  21. --swiftgrpc_opt=FileNaming=${FILE_NAMING},Visibility=${VISIBILITY}
  22. protoc "src/proto/grpc/testing/messages.proto" \
  23. --plugin=${PLUGIN_SWIFT} \
  24. --plugin=${PLUGIN_SWIFTGRPC} \
  25. --swift_out=${OUTPUT} \
  26. --swift_opt=FileNaming=${FILE_NAMING},Visibility=${VISIBILITY} \
  27. --swiftgrpc_out=${OUTPUT} \
  28. --swiftgrpc_opt=FileNaming=${FILE_NAMING},Visibility=${VISIBILITY}
  29. echo "The generated code needs to be modified to support testing an unimplemented method."
  30. echo "On the server side, the generated code needs to be removed so the server has no"
  31. echo "knowledge of it. Client code requires no modification, since it is required to call"
  32. echo "the unimplemented method.\n"
  33. echo "In the generated 'Grpc_Testing_TestServiceProvider' protocol code in ${OUTPUT}/test.grpc.swift:"
  34. echo "1. remove 'unimplementedCall(request:context:)'"
  35. echo "2. remove the 'UnimplementedCall' case from 'handleMethod(:request:serverHandler:GRPCChannelHandler:channel:errorDelegate)'"