-
Notifications
You must be signed in to change notification settings - Fork 420
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
Conversation
El-Moatasem
commented
Nov 24, 2021
- Adding Easy Installation Using Homebrew Package
- Adding Automatic Files Generation Script in Build Phases Xcode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patch @El-Moatasem, I left a few comments inline.
README.md
Outdated
@@ -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) |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
README.md
Outdated
@@ -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) | |||
1. Installing Swift-Protobuf : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Installing Swift-Protobuf : | |
1. Installing Swift Protobuf: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
```bash | ||
$ brew install swift-protobuf | ||
``` | ||
2. Installing GRPC-Swift : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Installing GRPC-Swift : | |
2. Installing gRPC Swift: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
### 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; | ||
``` |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
2) [MOD] Moving Homebrew Installation to "Getting the `protoc` Plugins" section
README.md
Outdated
@@ -131,6 +133,17 @@ the following line to your `Podfile`: | |||
pod 'gRPC-Swift-Plugins' | |||
``` | |||
|
|||
Homebrew (Easy Installation) | |||
The plugins are available from homebrew and can be installed with : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugins are available from homebrew and can be installed with : | |
The plugins are available from [homebrew](https://brew.sh) and can be installed with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
1. Installing Swift Protobuf : (swift-protobuf is installed as a dependency of grpc-swift) | ||
```bash | ||
$ brew install swift-protobuf | ||
``` | ||
2. Installing gRPC Swift : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Installing Swift Protobuf : (swift-protobuf is installed as a dependency of grpc-swift) | |
```bash | |
$ brew install swift-protobuf | |
``` | |
2. Installing gRPC Swift : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
``` | ||
2. Installing gRPC Swift : | ||
```bash | ||
$ brew install grpc-swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ brew install grpc-swift | |
$ brew install swift-protobuf grpc-swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
@@ -131,6 +131,18 @@ the following line to your `Podfile`: | |||
pod 'gRPC-Swift-Plugins' | |||
``` | |||
|
|||
#### Homebrew (Easy Installation) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### Homebrew (Easy Installation) : | |
#### Homebrew |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
@@ -131,6 +131,14 @@ the following line to your `Podfile`: | |||
pod 'gRPC-Swift-Plugins' | |||
``` | |||
|
|||
#### Homebrew : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### Homebrew : | |
#### Homebrew |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
#### Homebrew : | ||
|
||
The plugins are available from [homebrew](https://brew.sh) and can be installed with: | ||
1. Installing Swift Protobuf / gRPC Swift : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Installing Swift Protobuf / gRPC Swift : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
README.md
Outdated
```bash | ||
$ brew install swift-protobuf grpc-swift | ||
``` | ||
|
||
The plugins are available in the `Pods/gRPC-Swift-Plugins/` folder afterwards. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this line has escaped from the section above, it should come before the #### Homebrew
line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
You are right!
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!