Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gPRC swift protobuf easy installation + easy file generataions #1318

Merged
merged 11 commits into from
Nov 24, 2021
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ all four gRPC API styles (Unary, Server Streaming, Client Streaming, and
Bidirectional Streaming) and connections can be made either over secure (TLS) or
insecure channels.


## Homebrew (Easy Installation)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is just another way of getting the plugins for protoc, could you move this into the "Getting the protoc plugins" section? I don't think it needs its own subsection either; it just needs a note to say that the plugins are available from homebrew and can be installed with brew install grpc-swift (swift-protobuf is installed as a dependency of grpc-swift)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok Sure
I will move it there "Getting the protoc plugins" section
Thanks

1. Installing Swift-Protobuf :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Installing Swift-Protobuf :
1. Installing Swift Protobuf:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

```bash
$ brew install swift-protobuf
```
2. Installing GRPC-Swift :
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Installing GRPC-Swift :
2. Installing gRPC Swift:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

```bash
$ brew install grpc-swift
```

## Versions

gRPC Swift has recently been rewritten on top of [SwiftNIO][swift-nio] as
Expand Down Expand Up @@ -133,6 +144,23 @@ the following line to your `Podfile`:

The plugins are available in the `Pods/gRPC-Swift-Plugins/` folder afterwards.


### Easy Files Generation:

When you have *.proto files in "Data/gRPC_Schema" in Xcode directory
You can add Build Phase Script for automatic generation for swift fils *.pb.swift and *.grpc.swift files on the same directory "Data/gRPC_Schema"

```bash
cd "${SRCROOT}/${TARGET_NAME}/Data/gRPC_Schema"
currentPath = "${SRCROOT}/${TARGET_NAME}/Data/gRPC_Schema"
for i in $(ls | egrep '\.proto$');
do echo "$i";
protoc "$i" \
--swift_out=Visibility=Public:. \
--grpc-swift_out=Visibility=Public,Client=true,Server=false:.;

done;
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should include this section: build phase scripts aren't an unknown feature and the script itself is fairly simple. It's also highly likely to be different for different folks (different paths to .proto files, different plugin options and so on).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok Great
I think it depends on your usage and it's not complicated to build
I will remove it
Thanks

## Examples

gRPC Swift has a number of tutorials and examples available. They are split
Expand Down