Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2015, gRPC Authors All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
edition = "2024";

package helloworld;

// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello(HelloRequest) returns (HelloReply) {}
}

// The request message containing the user's name.
message HelloRequest {
string name = 1;
}

// The response message containing the greetings
message HelloReply {
string message = 1;
}
2 changes: 1 addition & 1 deletion Sources/protoc-gen-grpc-swift-2/GenerateGRPC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class GenerateGRPC: SwiftProtobufPluginLibrary.CodeGenerator {
}

var supportedEditionRange: ClosedRange<Google_Protobuf_Edition> {
Google_Protobuf_Edition.proto2 ... Google_Protobuf_Edition.edition2023
Google_Protobuf_Edition.proto2 ... Google_Protobuf_Edition.edition2024
}

// A count of generated files by desired name (actual name may differ to avoid collisions).
Expand Down
20 changes: 19 additions & 1 deletion dev/setup-plugin-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,28 @@ function test_07_duplicated_proto_file_name {
cp "${config}/internal-grpc-swift-proto-generator-config.json" "${test_dir}/Sources/Protos/grpc-swift-proto-generator-config.json"
}

function test_08_edition2024 {
# .
# ├── Package.swift
# └── Sources
# ├── HelloWorldAdopter.swift
# ├── Protos
# │ └── HelloWorld_edition2024.proto
# └── grpc-swift-proto-generator-config.json

local -r test_dir=$(test_dir_name)
mkdir -p "${test_dir}/Sources/Protos"
cp "${package_manifest}" "${test_dir}/"
cp "${sources}/HelloWorldAdopter.swift" "${test_dir}/Sources/"
cp "${protos}/HelloWorld/HelloWorld_edition2024.proto" "${test_dir}/Sources/Protos"
cp "${config}/internal-grpc-swift-proto-generator-config.json" "${test_dir}/Sources/grpc-swift-proto-generator-config.json"
}

test_01_top_level_config_file
test_02_peer_config_file
test_03_separate_service_message_protos
test_04_cross_directory_imports
test_05_two_definitions
test_06_nested_definitions
test_07_duplicated_proto_file_name
test_07_duplicated_proto_file_name
test_08_edition2024
Loading