Skip to content

Commit e3f69fd

Browse files
authored
Prepare for a 1.31.0 release and update docs (#1843)
# Motivations In the previous PRs, I landed support for distributing `protoc` via this repo which finally allows us to broadly recommend the SPM plugin. # Modifications This PR bumps the versions and updates the docs for the SPM plugin and a tiny addition to the RELEASING doc to ensure the latest check is set. # Result Unblocking the ecosystem in broadly adopting the SPM plugin.
1 parent 6ceb2da commit e3f69fd

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

Documentation/RELEASING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ When doing a Swift Protobuf library release:
5454
For the description click the _Generate release notes_ button. That should do
5555
everything based on the PR descriptions and _semver_ tags in the repo. Just read
5656
though was was generate to see if any tweaks are needed.
57+
58+
*Important* Ensure that the `Set as the latest release` is checked.
5759

5860
1. Publish the `SwiftProtobuf.podspec`
5961

Sources/SwiftProtobuf/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public struct Version {
1919
/// Major version.
2020
public static let major = 1
2121
/// Minor version.
22-
public static let minor = 30
22+
public static let minor = 31
2323
/// Revision number.
2424
public static let revision = 0
2525

Sources/protoc-gen-swift/Docs.docc/spm-plugin.md

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,16 @@ is generating Swift types for the `Bar.proto` file with the `public` visibility.
105105
invocation is using the `pathToUnderscores` file naming option. This option can be used to solve
106106
problems where a single target contains two or more proto files with the same name.
107107

108-
### Defining the path to the protoc binary
108+
### Overriding the path to the protoc binary
109109

110-
The plugin needs to be able to invoke the `protoc` binary to generate the Swift types. There are several ways to achieve this.
110+
The plugin needs to be able to invoke the `protoc` binary to generate the Swift types.
111+
By default the plugin will use the latest `protoc` binary distributed as an
112+
artifact bundle from the [swift-protobuf releases](https://github.com/apple/swift-protobuf/releases).
111113

112-
First, by default, the package manager looks into the `$PATH` to find binaries named `protoc`.
113-
This works immediately if you use `swift build` to build your package and `protoc` is installed
114-
in the `$PATH` (`brew` is adding it to your `$PATH` automatically).
115-
However, this doesn't work if you want to compile from Xcode since Xcode is not passed the `$PATH`.
114+
There are several ways for you to override the path to the `protoc` binary.
116115

117-
If compiling from Xcode, you have **three options** to set the path of `protoc` that the plugin is going to use:
118-
119-
* You can start Xcode by running `$ xed .` from the command line from the directory your project is located - this should make `$PATH` visible to Xcode.
120-
121-
* Set an environment variable `PROTOC_PATH` that gets picked up by the plugin. Here are two examples of how you can achieve this:
116+
* Set an environment variable `PROTOC_PATH` that gets picked up by the plugin.
117+
Here are two examples of how you can achieve this:
122118

123119
```shell
124120
# swift build
@@ -131,7 +127,9 @@ env PROTOC_PATH=/opt/homebrew/bin/protoc xed .
131127
env PROTOC_PATH=/opt/homebrew/bin/protoc xcodebuild <Here goes your command>
132128
```
133129

134-
* Point the plugin to the concrete location of the `protoc` compiler is by changing the configuration file like this:
130+
* Point the plugin to the concrete location of the `protoc` compiler is by changing
131+
the configuration file. This is only advisable for applications and not libaries
132+
since it forces the user of the library to install `protoc` into the expected location.
135133

136134
```json
137135
{
@@ -147,8 +145,3 @@ env PROTOC_PATH=/opt/homebrew/bin/protoc xcodebuild <Here goes your command>
147145
`exclude` argument for the target). The build system does not have access to
148146
the file if it is excluded, however, `swift build` will result in a warning
149147
that the file should be excluded.
150-
- The plugin should only be used for leaf packages. The configuration file option
151-
only solves the problem for leaf packages that are using the Swift package
152-
manager plugin since there you can point the package manager to the right
153-
binary. The environment variable does solve the problem for transitive
154-
packages as well; however, it requires your users to set the variable now.

SwiftProtobuf.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'SwiftProtobuf'
3-
s.version = '1.30.0'
3+
s.version = '1.31.0'
44
s.license = { :type => 'Apache 2.0', :file => 'LICENSE.txt' }
55
s.summary = 'Swift Protobuf Runtime Library'
66
s.homepage = 'https://github.com/apple/swift-protobuf'

0 commit comments

Comments
 (0)