Skip to content

Commit ff72257

Browse files
authored
Merge branch 'main' into access-level-on-imports
2 parents e42cc69 + 7d129ce commit ff72257

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Installing protoc
2+
3+
Learn how to install `protoc`, the Protocol Buffers compiler.
4+
5+
## Overview
6+
7+
The Protocol Buffers compiler is a command line tool for generating source code from `.proto`
8+
files and is required to generate gRPC stubs and messages. You can learn more about it on the
9+
[Protocol Buffers website](https://protobuf.dev/).
10+
11+
You can install `protoc` in a number of ways including:
12+
13+
1. Via a package manager,
14+
2. By downloading the binary.
15+
16+
### Install via a package manager
17+
18+
Using a package manager is the easiest way to install `protoc`.
19+
20+
On macOS you can use [Homebrew](https://brew.sh):
21+
22+
```sh
23+
brew install protobuf
24+
```
25+
26+
On Ubuntu and Debian you can use `apt`:
27+
28+
```sh
29+
apt update && apt install -y protobuf-compiler
30+
```
31+
32+
On Fedora you can use `dnf`:
33+
34+
```sh
35+
dnf install -y protobuf-compiler
36+
```
37+
38+
### Installing a pre-built binary
39+
40+
If you're unable to use a package manager to install `protoc` then you may be able
41+
to download a pre-built binary from the [Protocol Buffers GitHub
42+
repository](https://github.com/protocolbuffers/protobuf).
43+
44+
First, find and download the appropriate binary for your system from the
45+
[releases](https://github.com/protocolbuffers/protobuf/releases) page.
46+
47+
Next, unzip the artifact to a directory called `protoc`:
48+
49+
```sh
50+
unzip /path/to/downloaded/protoc-{VERSION}-{OS}.zip -d protoc
51+
```
52+
53+
Finally, move `protoc/bin/protoc` to somewhere in your `$PATH` such as `/usr/local/bin`:
54+
55+
```sh
56+
mv protoc/bin/protoc /usr/local/bin
57+
```
58+
59+
You can now remove the `protoc` directory.

Sources/GRPCProtobuf/Documentation.docc/Documentation.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ A package integrating Swift Protobuf with gRPC Swift.
44

55
## Overview
66

7-
This package provides two products:
7+
This package provides three products:
88
- ``GRPCProtobuf``, a module providing runtime serialization and deserialization components for
99
[SwiftProtobuf](https://github.com/apple/swift-protobuf).
1010
- `protoc-gen-grpc-swift`, an executable which is a plugin for `protoc`, the Protocol Buffers
1111
compiler. An article describing how to generate gRPC Swift stubs using it is available with the
1212
`grpc-swift` documentation on the [Swift Package
1313
Index](https://swiftpackageindex.com/grpc/grpc-swift/documentation).
14+
- `GRPCProtobufGenerator`, a Swift Package build plugin for generating stubs as part of the build
15+
process.
16+
17+
## Essentials
18+
19+
- <doc:Installing-protoc>
1420

1521
## Topics
1622

0 commit comments

Comments
 (0)